summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-07-15 18:17:31 +0000
committermav <mav@FreeBSD.org>2013-07-15 18:17:31 +0000
commit1f49e221e7839234da418c5e13c0af79dddc4c41 (patch)
tree4a09e31498b06704d29bd9d57a04692603291f00 /sys/cam/cam_xpt.c
parentb8930f9894200728d68dab5751a9611333d3caba (diff)
downloadFreeBSD-src-1f49e221e7839234da418c5e13c0af79dddc4c41.zip
FreeBSD-src-1f49e221e7839234da418c5e13c0af79dddc4c41.tar.gz
Make some improvements to r253322 to really rescan target, not a bus.
Add there and in two more places checks for NULL on xpt_alloc_ccb_nowait().
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r--sys/cam/cam_xpt.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 3511265..8f2c93e 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -3900,10 +3900,13 @@ xpt_bus_register(struct cam_sim *sim, device_t parent, u_int32_t bus)
xpt_async(AC_PATH_REGISTERED, path, &cpi);
/* Initiate bus rescan. */
scan_ccb = xpt_alloc_ccb_nowait();
- scan_ccb->ccb_h.path = path;
- scan_ccb->ccb_h.func_code = XPT_SCAN_BUS;
- scan_ccb->crcn.flags = 0;
- xpt_rescan(scan_ccb);
+ if (scan_ccb != NULL) {
+ scan_ccb->ccb_h.path = path;
+ scan_ccb->ccb_h.func_code = XPT_SCAN_BUS;
+ scan_ccb->crcn.flags = 0;
+ xpt_rescan(scan_ccb);
+ } else
+ xpt_print(path, "Can't allocate CCB to scan bus\n");
} else
xpt_free_path(path);
return (CAM_SUCCESS);
OpenPOWER on IntegriCloud