summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2009-01-23 21:03:59 +0000
committertrasz <trasz@FreeBSD.org>2009-01-23 21:03:59 +0000
commit384c3ce8d25837258013a1eefd7267c75f6df4f6 (patch)
treee58f9b0f3e4bd6ac9bc9ba20d4a61a17a718d05b /sys/cam
parenta622abe85f60142e95ce8e08a8131e36119e5bfc (diff)
downloadFreeBSD-src-384c3ce8d25837258013a1eefd7267c75f6df4f6.zip
FreeBSD-src-384c3ce8d25837258013a1eefd7267c75f6df4f6.tar.gz
Guard against NULL pointer dereference.
Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 130
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_periph.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index 3abeed8..9fdc112 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -171,6 +171,10 @@ cam_periph_alloc(periph_ctor_t *periph_ctor,
break;
}
xpt_unlock_buses();
+ if (p_drv == NULL) {
+ printf("cam_periph_alloc: invalid periph name '%s'\n", name);
+ return (CAM_REQ_INVALID);
+ }
sim = xpt_path_sim(path);
path_id = xpt_path_path_id(path);
OpenPOWER on IntegriCloud