Date: Fri, 23 Jan 2009 21:03:59 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r187649 - head/sys/cam Message-ID: <200901232103.n0NL3xCj054206@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Fri Jan 23 21:03:59 2009 New Revision: 187649 URL: http://svn.freebsd.org/changeset/base/187649 Log: Guard against NULL pointer dereference. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Found with: Coverity Prevent(tm) CID: 130 Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Fri Jan 23 20:53:01 2009 (r187648) +++ head/sys/cam/cam_periph.c Fri Jan 23 21:03:59 2009 (r187649) @@ -171,6 +171,10 @@ cam_periph_alloc(periph_ctor_t *periph_c break; } xpt_unlock_buses(); + if (p_drv == NULL) { + printf("cam_periph_alloc: invalid periph name '%s'\n", name); + return (CAM_REQ_INVALID); + } sim = xpt_path_sim(path); path_id = xpt_path_path_id(path);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901232103.n0NL3xCj054206>