On Fri, 7 Aug 2009, Davidlohr Bueso A. wrote: > Verify that ch->dt is not NULL before using it: > ch-dt[elem] = value; It looks like buffer should be freed as well? julia > Signed-off-by: Davidlohr Bueso > > --- > drivers/scsi/ch.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c > index 7b1633a..96cbd20 100644 > --- a/drivers/scsi/ch.c > +++ b/drivers/scsi/ch.c > @@ -353,6 +353,10 @@ 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) > + return -ENOMEM; > + > for (elem = 0; elem < ch->counts[CHET_DT]; elem++) { > id = -1; > lun = 0; > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html