[ofw] PATCH: Free spinlock in the case of an error.
Leonid Keller
leonid at mellanox.co.il
Tue Mar 24 06:57:33 PDT 2009
Applied with some changes in 2040, thank you.
________________________________
From: ofw-bounces at lists.openfabrics.org
[mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Tzachi Dar
Sent: Sunday, March 15, 2009 12:31 PM
To: ofw at lists.openfabrics.org
Subject: [ofw] PATCH: Free spinlock in the case of an error.
Index: Q:/projinf2/trunk/hw/mlx4/kernel/bus/net/catas.c
===================================================================
--- Q:/projinf2/trunk/hw/mlx4/kernel/bus/net/catas.c (revision
4101)
+++ Q:/projinf2/trunk/hw/mlx4/kernel/bus/net/catas.c (working
copy)
@@ -345,6 +345,7 @@
{
struct ib_device *ibdev;
struct mlx4_dev *dev;
+ int err = 0;
unsigned long flags;
@@ -370,17 +371,19 @@
// to allow for end of operations that are in progress
reset_work = IoAllocateWorkItem( dev->pdev->p_self_do );
if (!reset_work) {
+ spin_unlock_irqrestore(&ibdev->event_handler_lock, flags);
mlx4_err(dev, "mlx4_reset_request IoAllocateWorkItem failed,
reset will not be propagated\n");
- return -EFAULT;
+ err = -EFAULT;
+ goto err_workitem;
}
event_handler->rsrv_ptr = reset_work;
IoQueueWorkItem( reset_work, card_reset_wi, DelayedWorkQueue,
event_handler );
}
-
+err_workitem:
spin_unlock_irqrestore(&ibdev->event_handler_lock, flags);
- return 0;
+ return err;
}
int mlx4_reset_cb_register( struct ib_event_handler
*event_handler )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090324/ad3ab24a/attachment.html>
More information about the ofw
mailing list