[ofw] PATCH: Free spinlock in the case of an error.

Tzachi Dar tzachid at mellanox.co.il
Sun Mar 15 03:31:09 PDT 2009


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/20090315/f9a7a382/attachment.html>


More information about the ofw mailing list