[MLX4] fix in error flow.
[mirror/winof/.git] / hw / mlx4 / kernel / bus / net / catas.c
index 0fe6011..6c78ac6 100644 (file)
@@ -345,7 +345,6 @@ int mlx4_reset_request( struct ib_event_handler *event_handler )
 {
        struct ib_device *ibdev;
        struct mlx4_dev *dev;
-       int err = 0;
 
        unsigned long flags;
 
@@ -359,6 +358,7 @@ 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;
@@ -372,16 +372,16 @@ int mlx4_reset_request( struct ib_event_handler *event_handler )
                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");
-                       err = -EFAULT;
-                       goto err_workitem;
+                       return -EFAULT;
                }
                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 err;
+
+
+       return 0;
 }
 
 int mlx4_reset_cb_register( struct ib_event_handler *event_handler )