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:
parent
b17dd2bcc0
commit
fa81466148
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126104
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user