Submitted by: bde@zeta.org.au (Bruce Evans)

Fix it so that calls to extend_get won't dereference 0 when "swap
on sd.." calls sdsize() on systems with no SCSI devices.

This probably really fixes Poul's "boot with no SCSI" problem.
This commit is contained in:
Peter Dufault 1995-03-06 15:02:13 +00:00
parent f7ae0afb88
commit 558b7c23d1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6936

View file

@ -16,7 +16,7 @@
* *
* New configuration setup: dufault@hda.com * New configuration setup: dufault@hda.com
* *
* $Id: scsiconf.c,v 1.20 1995/03/01 22:24:43 dufault Exp $ * $Id: scsiconf.c,v 1.21 1995/03/04 20:50:58 dufault Exp $
*/ */
#include <sys/types.h> #include <sys/types.h>
@ -100,8 +100,8 @@ void *extend_set(struct extend_array *ea, int index, void *value)
void *extend_get(struct extend_array *ea, int index) void *extend_get(struct extend_array *ea, int index)
{ {
if (index >= ea->nelem || index < 0) if (ea == NULL || index >= ea->nelem || index < 0)
return 0; return NULL;
return ea->ps[index]; return ea->ps[index];
} }