Received: by 10.192.165.148 with SMTP id m20csp573198imm; Wed, 25 Apr 2018 04:30:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/DsAlr4fRYOjk/My953QKA2cj48oKsCmjpXE+rFzz1io8vf1l77TByRkvTJRWE+kqI2wJ6 X-Received: by 10.98.13.71 with SMTP id v68mr27524379pfi.69.1524655819342; Wed, 25 Apr 2018 04:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524655819; cv=none; d=google.com; s=arc-20160816; b=T8hNj7HCuO1yARiS/WOcMQfzU0bcHWqrHouXS45ENWkFTWkYlZv9sGwvAmSGzKcZGM 2wvxAIriGz+ybf5RlvMyTrfl+49jTHFz6UWQtXUa2GTH8SkN8qRrprN4SolS5V1ZpP16 KSrA8uT6WBj5Pgz8pD6BuBAmhwvNdaEpnzuFHRhjfR8WaYw4NOKI9jOSFaMzu92gwEyl MHhmaljq5re8OUQEPukt4FRLrZW9CCuYDJuRFd8YP3XSOZ5z0uNqLhHkgkX3frn8v6VB wkX/VMV1WaerZuSp9Cfk0fICPYsRer+mkP0YC3zi6kdQeX5HdnV6tP6HhV7zft73FHXC YgKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=yZbsrM3F9eU7vjfuAXMc67buNWLMnFihRvyQD8xOuZY=; b=vsnlQP2wblJCDdRHepMNzviMusqjMc/kIHt2hKoFxWNZM2G3rZWO6ZZHxMjIZbamK4 HyjjInxkLu3nmOCJ1sHkNHE6bWipkxvBLkbTtGS3ji7wXXafDz2Mu0RNWl3VQRUhfU1Y v+KuiAGO2FVEhUQb6Grud2rkYVCXBRSU9t5YHFksqPEkIJJTbA9TKdmqGS+maWY1IEXt UnONQCdCex4sAtvxWbJDJi+4r6u5oEMpbogsiy9O6l9+oP54XzI81d0UH/ioQRVFXE5w 4BXTRZ2eIfl7qG3Rg0ajsSd8iFToQ0/PJWrTJ3faiiDwkx/L7IB4HtO8Er7CySPEa52N iN/A== ARC-Authentication-Results: i=1; mx.google.com; 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 145si11830960pgd.561.2018.04.25.04.30.04; Wed, 25 Apr 2018 04:30:19 -0700 (PDT) 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; 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 S1753860AbeDYL2v (ORCPT + 99 others); Wed, 25 Apr 2018 07:28:51 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51344 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752205AbeDYKiS (ORCPT ); Wed, 25 Apr 2018 06:38:18 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BE6484A5; Wed, 25 Apr 2018 10:38:17 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quinn Tran , Himanshu Madhani , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.14 037/183] scsi: qla2xxx: Fix warning in qla2x00_async_iocb_timeout() Date: Wed, 25 Apr 2018 12:34:17 +0200 Message-Id: <20180425103244.069187056@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: "himanshu.madhani@cavium.com" [ Upstream commit 7ac0c332f96bb9688560726f5e80c097ed8de59a ] This patch fixes following Smatch warning: drivers/scsi/qla2xxx/qla_init.c:130 qla2x00_async_iocb_timeout() error: we previously assumed 'fcport' could be null (see line 107) Fixes: 5c25d451163c ("scsi: qla2xxx: Fix NULL pointer access for fcport structure") Reported by: Dan Carpenter Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_init.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -115,6 +115,8 @@ qla2x00_async_iocb_timeout(void *data) switch (sp->type) { case SRB_LOGIN_CMD: + if (!fcport) + break; /* Retry as needed. */ lio->u.logio.data[0] = MBS_COMMAND_ERROR; lio->u.logio.data[1] = lio->u.logio.flags & SRB_LOGIN_RETRIED ? @@ -128,6 +130,8 @@ qla2x00_async_iocb_timeout(void *data) qla24xx_handle_plogi_done_event(fcport->vha, &ea); break; case SRB_LOGOUT_CMD: + if (!fcport) + break; qlt_logo_completion_handler(fcport, QLA_FUNCTION_TIMEOUT); break; case SRB_CT_PTHRU_CMD: