diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/ch.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 7b1633a8c15a..fe11c1d4b31d 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c | |||
@@ -353,6 +353,12 @@ ch_readconfig(scsi_changer *ch) | |||
353 | /* look up the devices of the data transfer elements */ | 353 | /* look up the devices of the data transfer elements */ |
354 | ch->dt = kmalloc(ch->counts[CHET_DT]*sizeof(struct scsi_device), | 354 | ch->dt = kmalloc(ch->counts[CHET_DT]*sizeof(struct scsi_device), |
355 | GFP_KERNEL); | 355 | GFP_KERNEL); |
356 | |||
357 | if (!ch->dt) { | ||
358 | kfree(buffer); | ||
359 | return -ENOMEM; | ||
360 | } | ||
361 | |||
356 | for (elem = 0; elem < ch->counts[CHET_DT]; elem++) { | 362 | for (elem = 0; elem < ch->counts[CHET_DT]; elem++) { |
357 | id = -1; | 363 | id = -1; |
358 | lun = 0; | 364 | lun = 0; |