Author: mav
Date: Tue Oct 23 15:18:16 2012
New Revision: 241938
URL: http://svn.freebsd.org/changeset/base/241938

Log:
  MFC r241405:
  Really handle xpt_compile_path() error in xpt_bus_register() instead of
  print error message and probably crash just after it on NULL dereference.

Modified:
  stable/9/sys/cam/cam_xpt.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/cam_xpt.c
==============================================================================
--- stable/9/sys/cam/cam_xpt.c  Tue Oct 23 15:16:50 2012        (r241937)
+++ stable/9/sys/cam/cam_xpt.c  Tue Oct 23 15:18:16 2012        (r241938)
@@ -3898,8 +3898,11 @@ xpt_bus_register(struct cam_sim *sim, de
 
        status = xpt_compile_path(path, /*periph*/NULL, sim->path_id,
                                  CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
-       if (status != CAM_REQ_CMP)
-               printf("xpt_compile_path returned %d\n", status);
+       if (status != CAM_REQ_CMP) {
+               xpt_release_bus(new_bus);
+               free(path, M_CAMXPT);
+               return (CAM_RESRC_UNAVAIL);
+       }
 
        xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL);
        cpi.ccb_h.func_code = XPT_PATH_INQ;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "[email protected]"

Reply via email to