[MLX4] Free spinlock in the case of an error.
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 24 Mar 2009 13:57:02 +0000 (13:57 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 24 Mar 2009 13:57:02 +0000 (13:57 +0000)
Signed off by: Tzachi Dar

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2040 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mlx4/kernel/bus/net/catas.c

index 9bf15b9..9d5f497 100644 (file)
@@ -345,6 +345,7 @@ int mlx4_reset_request( struct ib_event_handler *event_handler )
 {
        struct ib_device *ibdev;
        struct mlx4_dev *dev;
+       int err = 0;
 
        unsigned long flags;
 
@@ -358,7 +359,6 @@ int mlx4_reset_request( struct ib_event_handler *event_handler )
 
        spin_lock_irqsave(&ibdev->event_handler_lock, &flags);
 
-        
        // set device to RESET_PENDING mode
        if (!(dev->flags & (MLX4_FLAG_RESET_CLIENT | MLX4_FLAG_RESET_DRIVER))) {
                PIO_WORKITEM reset_work;
@@ -371,16 +371,16 @@ int mlx4_reset_request( struct ib_event_handler *event_handler )
                reset_work = IoAllocateWorkItem( dev->pdev->p_self_do );
                if (!reset_work) {
                        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 )