]> err.no Git - linux-2.6/blobdiff - drivers/scsi/sr_ioctl.c
[PATCH] Add missing overflow check in get_blkdev_list
[linux-2.6] / drivers / scsi / sr_ioctl.c
index 3471be05779a5220e40eb3e67d32ad3ee7b6bd8e..82d68fdb15484520abd80d1aa603d2395a86ad6b 100644 (file)
@@ -281,6 +281,9 @@ int sr_get_mcn(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn)
        char *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 */