Author: trasz Date: Sat Feb 28 10:59:48 2009 New Revision: 189158 URL: http://svn.freebsd.org/changeset/base/189158
Log: MFC r187650: Guard against NULL pointer dereference. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 1847 Modified: stable/7/sys/ (props changed) stable/7/sys/cam/cam_xpt.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/cam/cam_xpt.c ============================================================================== --- stable/7/sys/cam/cam_xpt.c Sat Feb 28 10:53:20 2009 (r189157) +++ stable/7/sys/cam/cam_xpt.c Sat Feb 28 10:59:48 2009 (r189158) @@ -4177,7 +4177,10 @@ xpt_path_string(struct cam_path *path, c { struct sbuf sb; - mtx_assert(path->bus->sim->mtx, MA_OWNED); +#ifdef INVARIANTS + if (path != NULL && path->bus != NULL && path->bus->sim != NULL) + mtx_assert(path->bus->sim->mtx, MA_OWNED); +#endif sbuf_new(&sb, str, str_len, 0); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"