From d374d7f398b846dc59d8a5ec3c7bfb318cf880af Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 4 Feb 2014 00:51:06 +0000 Subject: [PATCH] MFC r260996: Fix memory and references leak due to unfreed path in case we can't allocate bus scan CCB. --- sys/cam/cam_xpt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 562d7ba36aa5..5444d0a07de7 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -3917,9 +3917,11 @@ xpt_bus_register(struct cam_sim *sim, device_t parent, u_int32_t bus) scan_ccb->ccb_h.func_code = XPT_SCAN_BUS; scan_ccb->crcn.flags = 0; xpt_rescan(scan_ccb); - } else + } else { xpt_print(path, "Can't allocate CCB to scan bus\n"); + xpt_free_path(path); + } } else xpt_free_path(path); } else