Check that periph is non-NULL before dereferencing it.

Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor), ken (scsi@)
This commit is contained in:
Colin Percival 2004-02-22 01:14:54 +00:00
parent b17dd2bcc0
commit fa81466148
1 changed files with 1 additions and 1 deletions

View File

@ -464,11 +464,11 @@ daopen(struct disk *dp)
s = splsoftcam();
periph = (struct cam_periph *)dp->d_drv1;
unit = periph->unit_number;
if (periph == NULL) {
splx(s);
return (ENXIO);
}
unit = periph->unit_number;
softc = (struct da_softc *)periph->softc;