diff options
author | scottl <scottl@FreeBSD.org> | 2005-02-20 23:45:49 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2005-02-20 23:45:49 +0000 |
commit | e02b7c32b9b55229a5830a2918e6c186ad9d023c (patch) | |
tree | a3c7fbd142d535e256774f5118144740b3e8e64f /sys/cam | |
parent | 2106f5124c0853e2d6f42c64ae8e90e930b01287 (diff) | |
download | FreeBSD-src-e02b7c32b9b55229a5830a2918e6c186ad9d023c.zip FreeBSD-src-e02b7c32b9b55229a5830a2918e6c186ad9d023c.tar.gz |
Protect against trying to free a non-existant peripheral.
Submitted by: Coverity Prevent analysis tool
MFC After: 3 days
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/cam_periph.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 0021d4e..8a9a89f 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -445,6 +445,10 @@ camperiphfree(struct cam_periph *periph) if (strcmp((*p_drv)->driver_name, periph->periph_name) == 0) break; } + if (*p_drv == NULL) { + printf("camperiphfree: attempt to free non-existant periph\n"); + return; + } if (periph->periph_dtor != NULL) periph->periph_dtor(periph); |