[libata passthru] fix leak on error
authorJeff Raubitschek <jhr@google.com>
Tue, 4 Oct 2005 14:21:19 +0000 (10:21 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Tue, 4 Oct 2005 14:21:19 +0000 (10:21 -0400)
drivers/scsi/libata-scsi.c

index 98057563a3cca6292ea9175cf9ac8f49ed55b13e..75cb685e320b76133b1d011fe632a96d4dffad22 100644 (file)
@@ -116,8 +116,10 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg)
        if (args[3]) {
                argsize = SECTOR_SIZE * args[3];
                argbuf = kmalloc(argsize, GFP_KERNEL);
-               if (argbuf == NULL)
-                       return -ENOMEM;
+               if (argbuf == NULL) {
+                       rc = -ENOMEM;
+                       goto error;
+               }
 
                scsi_cmd[1]  = (4 << 1); /* PIO Data-in */
                scsi_cmd[2]  = 0x0e;     /* no off.line or cc, read from dev,