From owner-svn-src-head@freebsd.org Mon May 9 16:34:07 2016 Return-Path: Delivered-To: svn-src-head@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 E8AFEB33BA6; Mon, 9 May 2016 16:34:07 +0000 (UTC) (envelope-from slm@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 mx1.freebsd.org (Postfix) with ESMTPS id BA3CC1960; Mon, 9 May 2016 16:34:07 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u49GY6TF040236; Mon, 9 May 2016 16:34:06 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u49GY6KU040235; Mon, 9 May 2016 16:34:06 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201605091634.u49GY6KU040235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 9 May 2016 16:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299272 - head/sys/dev/mpr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2016 16:34:08 -0000 Author: slm Date: Mon May 9 16:34:06 2016 New Revision: 299272 URL: https://svnweb.freebsd.org/changeset/base/299272 Log: done_ccb pointer can be used if it is NULL. To prevent this, move check for done_ccb == NULL to before done_ccb is used in mprsas_stop_unit_done(). Reviewed by: ken, scottl, ambrisko, asomers Approved by: ken, scottl, ambrisko MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6099 Modified: head/sys/dev/mpr/mpr_sas_lsi.c Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Mon May 9 16:31:43 2016 (r299271) +++ head/sys/dev/mpr/mpr_sas_lsi.c Mon May 9 16:34:06 2016 (r299272) @@ -1272,15 +1272,15 @@ mprsas_stop_unit_done(struct cam_periph struct mprsas_softc *sassc; char path_str[64]; + if (done_ccb == NULL) + return; + sassc = (struct mprsas_softc *)done_ccb->ccb_h.ppriv_ptr1; xpt_path_string(done_ccb->ccb_h.path, path_str, sizeof(path_str)); mpr_dprint(sassc->sc, MPR_INFO, "Completing stop unit for %s\n", path_str); - if (done_ccb == NULL) - return; - /* * Nothing more to do except free the CCB and path. If the command * timed out, an abort reset, then target reset will be issued during