]> Pileus Git - ~andy/linux/blobdiff - drivers/scsi/ch.c
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / drivers / scsi / ch.c
index 7b1633a8c15aaac9da83c97255562c050a819112..fe11c1d4b31d58a5cab85c92be0e8e824330f9ae 100644 (file)
@@ -353,6 +353,12 @@ ch_readconfig(scsi_changer *ch)
        /* look up the devices of the data transfer elements */
        ch->dt = kmalloc(ch->counts[CHET_DT]*sizeof(struct scsi_device),
                         GFP_KERNEL);
+
+       if (!ch->dt) {
+               kfree(buffer);
+               return -ENOMEM;
+       }
+
        for (elem = 0; elem < ch->counts[CHET_DT]; elem++) {
                id  = -1;
                lun = 0;