From patchwork Wed Dec 16 23:11:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 7866651 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B95369F54F for ; Wed, 16 Dec 2015 23:12:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03205202FF for ; Wed, 16 Dec 2015 23:12:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 313EB20396 for ; Wed, 16 Dec 2015 23:12:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755296AbbLPXMX (ORCPT ); Wed, 16 Dec 2015 18:12:23 -0500 Received: from mail-pf0-f181.google.com ([209.85.192.181]:34182 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754952AbbLPXMQ (ORCPT ); Wed, 16 Dec 2015 18:12:16 -0500 Received: by mail-pf0-f181.google.com with SMTP id 68so19522161pfc.1 for ; Wed, 16 Dec 2015 15:12:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=date:from:to:subject:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=fen/9tuh7hitNjFhBQ9NczA8cukId9kBMV72kaBG/7I=; b=OD+SmqjpoTSeMrbyQlvhhRNfMLqvw8oZbC5DUJaCTzdLDxKwdEjwgaKOQp2p8t1yrV IaLNaB89JRSdutNbTZRH4CtHOsj76hw2WdVhdD7499eCwMXbHZIkxRPRNO1czlGYROwn ICebcSGIdlQZCcdRAcSG/BjlNDI5NMaeemUM8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=fen/9tuh7hitNjFhBQ9NczA8cukId9kBMV72kaBG/7I=; b=LECT7xxW75pANbDtdyc8r4JRB3ER+f5srLPd/gAwVrzvwDU/hcz04a0RvoP4e3ru+v DOB2MZuJy55njc1NeW07+Mn4eA8MwIJ57S0RnKShQ6aBiXLdcKzFFWk//EQ47d+/BiPW nwmr2ZlRF1oPn8SAYjf5xC5ZOLK9I5NHCIKOvnS9AxwTollUR3OVLEqSTdnYEQFSxDgQ 5YfqjHfT+XFPiKJIkkbFp+mWjbPs5dM6/d62QwtUQLAZWMi1mumkPSwSp0hnyNWl6/lt AeUYGGwDcPJSh/aKkBqe2qRoBmsE2hpMPBT18aXWIIW9CH/V/N8Wv+LCsgvY1s+NYT42 QFtA== X-Gm-Message-State: ALoCoQmOcSDenkZ9b7lvqAnsk9gBQiTEw2uDRz7dB2YY1rZurcftYFmzBbRZCJVrUP9MfRt0L4HW3wOP5EejuyT04g9hpbOKpA== X-Received: by 10.98.32.77 with SMTP id g74mr9618018pfg.33.1450307535757; Wed, 16 Dec 2015 15:12:15 -0800 (PST) Received: from myfc17 (cm-wififw.emulex.com. [138.239.220.50]) by smtp.gmail.com with ESMTPSA id p86sm7013461pfa.54.2015.12.16.15.12.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 16 Dec 2015 15:12:14 -0800 (PST) Date: Wed, 16 Dec 2015 18:11:57 -0500 From: james.smart@avagotech.com (James Smart) To: linux-scsi@vger.kernel.org Subject: [PATCH 06/17] lpfc: Fix crash in fcp command completion path. Message-ID: <5671efbd.clWBAkJdlw7R8CdX%james.smart@avagotech.com> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix crash in fcp command completion path. Missed null check. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index d51f751..3162469 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -3908,9 +3908,9 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, uint32_t logit = LOG_FCP; /* Sanity check on return of outstanding command */ - if (!(lpfc_cmd->pCmd)) - return; cmd = lpfc_cmd->pCmd; + if (!cmd) + return; shost = cmd->device->host; lpfc_cmd->result = (pIocbOut->iocb.un.ulpWord[4] & IOERR_PARAM_MASK);