summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2004-02-22 01:14:54 +0000
committercperciva <cperciva@FreeBSD.org>2004-02-22 01:14:54 +0000
commitd3393323d627e0c98fe2dee6aba82d0fd381ad3d (patch)
tree8769d354bdd28440e1e972a67c56148f38b03baf /sys/cam
parent9f17986268a12a7b4a828eb338505725fdbcb954 (diff)
downloadFreeBSD-src-d3393323d627e0c98fe2dee6aba82d0fd381ad3d.zip
FreeBSD-src-d3393323d627e0c98fe2dee6aba82d0fd381ad3d.tar.gz
Check that periph is non-NULL before dereferencing it.
Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor), ken (scsi@)
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_da.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 7127eb0..216797d 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -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;
OpenPOWER on IntegriCloud