diff options
author | Nate Dailey <nhdailey@verizon.net> | 2005-04-21 16:14:05 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-04-21 16:14:05 -0400 |
commit | 3a73e8c7715cdf53c24b602bfca15ec54d7c989b (patch) | |
tree | ac2db6d657a1335f51226d58acf69a98173a0cbb /drivers | |
parent | 0bdcd78ea2342ad1a9c79cac99eefcfd0b3f1c2b (diff) |
[SCSI] drivers/scsi/sr_ioctl.c: check for failed allocation
I noticed a case in sr_ioctl.c's sr_get_mcn where a buffer is
allocated, but the pointer isn't checked for null.
Signed-off-by: Nate Dailey <nate.dailey@stratus.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/sr_ioctl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index 3471be05779a..82d68fdb1548 100644 --- a/drivers/scsi/sr_ioctl.c +++ b/drivers/scsi/sr_ioctl.c | |||
@@ -281,6 +281,9 @@ int sr_get_mcn(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn) | |||
281 | char *buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); | 281 | char *buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); |
282 | int result; | 282 | int result; |
283 | 283 | ||
284 | if (!buffer) | ||
285 | return -ENOMEM; | ||
286 | |||
284 | memset(&cgc, 0, sizeof(struct packet_command)); | 287 | memset(&cgc, 0, sizeof(struct packet_command)); |
285 | cgc.cmd[0] = GPCMD_READ_SUBCHANNEL; | 288 | cgc.cmd[0] = GPCMD_READ_SUBCHANNEL; |
286 | cgc.cmd[2] = 0x40; /* I do want the subchannel info */ | 289 | cgc.cmd[2] = 0x40; /* I do want the subchannel info */ |