Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4829338ybl; Wed, 22 Jan 2020 05:31:06 -0800 (PST) X-Google-Smtp-Source: APXvYqxLriEw5nkz3rPwF+BqHQaxSjq1TDLc8W2T4hMjKXeRdARLEru5ux/nUWE+lmcDnw4nBIoJ X-Received: by 2002:aca:398b:: with SMTP id g133mr6548954oia.11.1579699866134; Wed, 22 Jan 2020 05:31:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699866; cv=none; d=google.com; s=arc-20160816; b=kEyMtCX/1XTn8w7Y5xeH6U45tdSxwSyhhMhepygwobgegAK7N+a11FK6Im+wnATHvs TMSEpmzt7++KugXrvL/hu4mHughggm5xGoyGU+4Th95/3VXNCGicTrvE3eAMcMkoG7Ur 5ZoP2HAddxwNAjZuYAvwk3UFAyhWZdQtbrfbO2jw0NXoSiC8ky5eY6/A8gOGrEo19SoC Zuk8Iyb7dwW1kGlQtTi+8EoaypzxBow1LZzi4KQxG6AuL5Qla3BrRcvaoR6sFgMbJV39 DXWalnCtjF+82bknMh+v1tb+wF+OLBI0o5mfaoPmkFXE6PocqAu+mpgH0gg/krjpfq10 nGaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DNsS/tM0+MkZD9vRLxTyMUYw5dJykaZVneYsWJYz2aY=; b=YTsExfT6wVNyvOvjdQaleGcKGQJ9EQPaESZ6qqha0pf/zVTLetPEby4mNEU6kk5bnS MKgwANzZhYxk0i2nrW0dmNjPddMH1AxhkLBa60p1WKsWhtZq8eCz49EXDAnr3SOJjV5B y5MdXnoZTFDyqtC/TYyiupWLDJo6c34PgFDZdKJ+OFBHdLOAbIJjt1dKEDNr8EhR0wrK VhcSv882aV8KnXMmRVCNPgQAtbyLNBnOr5avxE6RelvEBZ/e2vw2IWV9lDDo7oy5FB4q iZOVnwFT9ehX74Vfz4q0TyFOy6GryPjl2qe1/MoG2vuXF8+7d2DwQ7YyQqIh0RzoAFjE KzMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Bniotb0F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4si20772742otl.214.2020.01.22.05.30.53; Wed, 22 Jan 2020 05:31:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Bniotb0F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729636AbgAVN33 (ORCPT + 99 others); Wed, 22 Jan 2020 08:29:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:48624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730879AbgAVN1U (ORCPT ); Wed, 22 Jan 2020 08:27:20 -0500 Received: from localhost (unknown [84.241.205.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 008A0205F4; Wed, 22 Jan 2020 13:27:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699639; bh=1Db3lYeWizfiMaW+Ghe6xbopy16WjdgWkpy59aWx5q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bniotb0FL/vM+Qwg83xOdS0sT7HOuV3/yW61I27MyHCBrf5IklSikkEv3kVIX9GLd 0CQOiQudNOQNZgo8HYdxN1fIIVFIO9MFFmtzudXfowbQ5n6ZO0EXtj8ncycAIKvfjh RYBfD1tkrkorLmVy+qPx9ssnvwe3rwFtx90QCmOk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org Subject: [PATCH 5.4 205/222] scsi: lpfc: fix: Coverity: lpfc_get_scsi_buf_s3(): Null pointer dereferences Date: Wed, 22 Jan 2020 10:29:51 +0100 Message-Id: <20200122092848.379097881@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart commit 6f23f8c5c9f1be4eb17c035129c80e49000c18a7 upstream. Coverity reported the following: --- drivers/scsi/lpfc/lpfc_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -719,7 +719,7 @@ lpfc_get_scsi_buf_s4(struct lpfc_hba *ph iocb->ulpLe = 1; iocb->ulpClass = CLASS3; - if (lpfc_ndlp_check_qdepth(phba, ndlp)) { + if (lpfc_ndlp_check_qdepth(phba, ndlp) && lpfc_cmd) { atomic_inc(&ndlp->cmd_pending); lpfc_cmd->flags |= LPFC_SBUF_BUMP_QDEPTH; }