From 54dac83c426a1a03bd139c5ac7e938890bd2693e Mon Sep 17 00:00:00 2001 From: Jeff Raubitschek Date: Tue, 4 Oct 2005 10:21:19 -0400 Subject: [libata passthru] fix leak on error --- drivers/scsi/libata-scsi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 98057563a3c..75cb685e320 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c @@ -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, -- cgit v1.2.3-18-g5258