drivers/scsi/sr_ioctl.c: check for failed allocation
PATCH 1/1 drivers/scsi/sr_ioctl.c: check for failed allocation
Hi,
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.
This patch against 2.6.12-rc2 adds a check.
Nate Dailey
Stratus Technologies
Signed-off-by Nate Dailey <[email protected]>
drivers/scsi/sr_ioctl.c renamed from drivers/scsi/sr_ioctl.c.orig +3 -0
@@ -281,6 +281,9 @@ int sr_get_mcn(struct cdrom_device_infochar *buffer =kmalloc (32 ,GFP_KERNEL |SR_GFP_DMA (cd));int result; +if (!buffer) +return -ENOMEM ; +memset (&cgc,0 ,sizeof (struct packet_command )); cgc.cmd[0 ] =GPCMD_READ_SUBCHANNEL ; cgc.cmd[2 ] =0x40 ;/* I do want the subchannel info */