1.3.20 scsi.c NULL dereference

Philip Blundell (pjb27@cam.ac.uk)
Sun, 20 Aug 1995 16:30:41 +0100 (BST)


There seems to be a bug in 1.3.20 that can cause scsi.c to dereference
NULL in low memory situations (it calls kmalloc() and doesn't check the
return value).

I think the attached patch should deal with the problem.

--- linux/drivers/scsi/scsi.c Fri Aug 4 00:51:07 1995
+++ linux/drivers/scsi/scsi.c Sun Aug 20 16:09:03 1995
@@ -2198,7 +2198,10 @@
scsi_init_memory_start += size;
}
}
- memset((void *) retval, 0, size);
+ if (retval)
+ memset((void *) retval, 0, size);
return (void *) retval;
}

--
Philip Blundell <pjb27@cam.ac.uk>       phone +44 1223 302522
.sig under construction