DragonFlyBSD Kernel Audit
DF-1024 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/bus/cam/cam_periph.c b/sys/bus/cam/cam_periph.c
--- a/sys/bus/cam/cam_periph.c
+++ b/sys/bus/cam/cam_periph.c
@@ -272,7 +272,8 @@
 		/* FALLTHROUGH */
 	case 1:
 		CAM_SIM_UNLOCK(sim);	/* sim was retrieved from path */
-		xpt_free_path(path);
+		if (path != NULL)
+			xpt_free_path(path);
 		kfree(periph, M_CAMPERIPH);
 		/* FALLTHROUGH */
 	case 0: