Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Feb 2009 10:53:20 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r189157 - in stable/7/sys: . cam contrib/pf dev/ath/ath_hal dev/cxgb
Message-ID:  <200902281053.n1SArKi5006754@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sat Feb 28 10:53:20 2009
New Revision: 189157
URL: http://svn.freebsd.org/changeset/base/189157

Log:
  MFC r187649:
  
  Guard against NULL pointer dereference.
  
  Reviewed by:	scottl
  Approved by:	rwatson (mentor)
  Sponsored by:	FreeBSD Foundation
  Found with:	Coverity Prevent(tm)
  CID:		130

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/cam/cam_periph.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_periph.c
==============================================================================
--- stable/7/sys/cam/cam_periph.c	Sat Feb 28 10:50:59 2009	(r189156)
+++ stable/7/sys/cam/cam_periph.c	Sat Feb 28 10:53:20 2009	(r189157)
@@ -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?200902281053.n1SArKi5006754>