From owner-svn-src-all@freebsd.org Tue Jan 9 00:00:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 744B0E6CBDE; Tue, 9 Jan 2018 00:00:56 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FEC07BF6B; Tue, 9 Jan 2018 00:00:56 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 916087000; Tue, 9 Jan 2018 00:00:55 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0900twW068920; Tue, 9 Jan 2018 00:00:55 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0900t4Y068919; Tue, 9 Jan 2018 00:00:55 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801090000.w0900t4Y068919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 9 Jan 2018 00:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327709 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 327709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jan 2018 00:00:56 -0000 Author: scottl Date: Tue Jan 9 00:00:55 2018 New Revision: 327709 URL: https://svnweb.freebsd.org/changeset/base/327709 Log: Protect against a possible NULL deference from an accessor function. Obtained from: Netflix Modified: head/sys/cam/cam_periph.h Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Mon Jan 8 22:59:36 2018 (r327708) +++ head/sys/cam/cam_periph.h Tue Jan 9 00:00:55 2018 (r327709) @@ -202,7 +202,10 @@ int cam_periph_error(union ccb *ccb, cam_flags camfla static __inline struct mtx * cam_periph_mtx(struct cam_periph *periph) { - return (xpt_path_mtx(periph->path)); + if (periph != NULL) + return (xpt_path_mtx(periph->path)); + else + return (NULL); } #define cam_periph_owned(periph) \