Skip to contentSkip to conversation

megaraid_sas: release lock on error path

PATCH In review Dan Carpenter 2 participants 2 messages Apr 16, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 megaraid_sas: release lock on error path

We should unlock here before returning.

drivers/scsi/megaraid/megaraid_sas_base.c +2 -1
index 9d53540..eb2385f 100644
@@ -4931,11 +4931,12 @@ static int megasas_mgmt_ioctl_fw(struct file *file, unsigned long arg)
 		printk(KERN_ERR "megaraid_sas: timed out while"
 			"waiting for HBA to recover\n");
 		error = -ENODEV;
-		goto out_kfree_ioc;
+		goto out_up;
 	}
 	spin_unlock_irqrestore(&instance->hba_lock, flags);
 
 	error = megasas_mgmt_fw_ioctl(instance, user_ioc, ioc);
+      out_up:
 	up(&instance->ioctl_sem);
 
       out_kfree_ioc:
Acked-by on v1 1/1
#1 lore raw
Quoted 23 lines · Dan Carpenter

We should unlock here before returning.

drivers/scsi/megaraid/megaraid_sas_base.c +2 -2
index 9d53540..eb2385f 100644
@@ -4931,11 +4931,12 @@ static int megasas_mgmt_ioctl_fw(struct file *file, unsigned long arg)
                printk(KERN_ERR "megaraid_sas: timed out while"
                        "waiting for HBA to recover\n");
                error = -ENODEV;
-               goto out_kfree_ioc;
+               goto out_up;
        }
        spin_unlock_irqrestore(&instance->hba_lock, flags);
 
        error = megasas_mgmt_fw_ioctl(instance, user_ioc, ioc);
+      out_up:
        up(&instance->ioctl_sem);
 
       out_kfree_ioc:
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Thanks Dan, this looks good.

-Adam