Skip to content

Commit

Permalink
[libata passthru] fix leak on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Raubitschek authored and Jeff Garzik committed Oct 4, 2005
1 parent 2ee73cc commit 54dac83
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/scsi/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 54dac83

Please sign in to comment.