Received: by 10.213.65.68 with SMTP id h4csp1733316imn; Mon, 19 Mar 2018 11:45:49 -0700 (PDT) X-Google-Smtp-Source: AG47ELuitJh7dS1MmS8nQ2DJVWoaCP4zFkx++nMAgOwI50ugiM/swt9F07b7Dx3GvMeAtYdwMXzx X-Received: by 10.98.14.215 with SMTP id 84mr6840220pfo.168.1521485149911; Mon, 19 Mar 2018 11:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521485149; cv=none; d=google.com; s=arc-20160816; b=jT51t7Y1MFNYVG7NBl9aX8qR53T5B5h1nOK3c4m6okJsEXICm+K79DpQQV9AHiayEl zrFXYa53y5Gk12ePHoZMMgO9zat20qNe5h04wSx0CucF3jE74CJdbhL9wEhri0WQvWUf ecBFFpVZnHJRKZLcV/7E47FMrxhrI75i2JAdqL1fBBJBnLAE4mp1oVJbB6AjYUVieP0c X6zSQyIt3ef4Vv9uvAYSx531jZoLjcW5QQ7o6v6nRr7eC1lDrvn6zVKoo/uWLL1HJEza xh01buWOfedtUpMRcNdVQaiAf8jnOcQNK0N6wo1gMt9Lxg7/mM36HpnBvbhni6BXeT+e 6URw== 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=AP8L7oFnbxrKXh/PRnDbrJjPjLlv1FmPR1fIrjvuEWo=; b=gs0IFmrjLXq1Ekb0C3Le1SK27FvU6GrWmJGJkSwfy2pIJCuFTD76x0EHPQZrRcLEvD rG7mfZu1h0iB4VZwofaaFKCHX4vUh9X3oYHCnyptmSHzdlcMJ1kfLTjO+dwrDd8d3IQV 3sXeGKZZzvS04Q5NhPtwQWZk7pVGmuToyVv7Wy8GKRTSrrdtC9niwPeeYWxrsTBQER1Y 3LqQa2MvlwJSTttEQrTgB34osmb1MP/NqnYA8tiizWDcqFy97v1Zu3wZhhrChwFU2KXR plFxf1mCz5busEg5t236Fj6aYmFC7hkCyVpxhO8XDAuUmQvetoyNYbdJXtqCbZNr8UH2 0RBA== 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 h12si286288pgn.317.2018.03.19.11.45.35; Mon, 19 Mar 2018 11:45:49 -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 S1032251AbeCSSnp (ORCPT + 99 others); Mon, 19 Mar 2018 14:43:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53960 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S970292AbeCSSc1 (ORCPT ); Mon, 19 Mar 2018 14:32:27 -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 C59DC1291; Mon, 19 Mar 2018 18:32:26 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Himanshu Madhani , "Martin K. Petersen" Subject: [PATCH 4.15 38/52] scsi: qla2xxx: Fix smatch warning in qla25xx_delete_{rsp|req}_que Date: Mon, 19 Mar 2018 19:08:36 +0100 Message-Id: <20180319180737.131838465@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180734.976730813@linuxfoundation.org> References: <20180319180734.976730813@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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Himanshu Madhani commit 62aa281470fdb7c0796d63a1cc918a8c1f02dde2 upstream. This patch fixes following warnings reported by smatch: drivers/scsi/qla2xxx/qla_mid.c:586 qla25xx_delete_req_que() error: we previously assumed 'req' could be null (see line 580) drivers/scsi/qla2xxx/qla_mid.c:602 qla25xx_delete_rsp_que() error: we previously assumed 'rsp' could be null (see line 596) Fixes: 7867b98dceb7 ("scsi: qla2xxx: Fix memory leak in dual/target mode") Reported-by: Dan Carpenter Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_mid.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -582,8 +582,9 @@ qla25xx_delete_req_que(struct scsi_qla_h ret = qla25xx_init_req_que(vha, req); if (ret != QLA_SUCCESS) return QLA_FUNCTION_FAILED; + + qla25xx_free_req_que(vha, req); } - qla25xx_free_req_que(vha, req); return ret; } @@ -598,8 +599,9 @@ qla25xx_delete_rsp_que(struct scsi_qla_h ret = qla25xx_init_rsp_que(vha, rsp); if (ret != QLA_SUCCESS) return QLA_FUNCTION_FAILED; + + qla25xx_free_rsp_que(vha, rsp); } - qla25xx_free_rsp_que(vha, rsp); return ret; }