Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3521013pxf; Mon, 15 Mar 2021 11:23:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQjFlAaL/j2wtycvZbr95HtpE6tWTLiGDYizPdHwN54bJS9p3YB6JcgsqKD5NZnBss9e98 X-Received: by 2002:a17:906:c414:: with SMTP id u20mr24942687ejz.215.1615832629630; Mon, 15 Mar 2021 11:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832629; cv=none; d=google.com; s=arc-20160816; b=b91ZDjvaAAETvEQzPQjULWWBDT3V+0hKU3N98p757iKvImqZJKfkEZ7wa3R0cwCkbZ y6kJZ+AggSIreBwBACiV4iTi6vJEzynlNdcHI7Ze6vd2KfuVEm2YRw8qLPm41kCeuGHg M8lcgZVjLJC20FfPGgruRt5zPOboN8ZVkYOaqDrYH+V7XL1wMlZXV6i8Zqua0cZQpigU wnNMXGMGcJJWi1HONapAekg9JWOMvSU0bQaDM0p6xNmifd9ZNfMinXBApPLDUpb3ChdL pw5GYcU6CEAu8vfIrns15iBSl/18s1FQK/EWwao0trpstJkSezITVA38nqidqTxmum31 QJ7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qkegVQEfOJnUsxYbR5svz4Av7Wv7r67MY04H+k72yb4=; b=ZpMrvjmlZ16YEbzybRVCh9eXUAaegvKhh2uVYe6xgCgjDeP13KzLE+e4YiaP0zdV/F nK3UiV7PlTNDz5qZ+e8S8cb0BMxFuQWj/MSsuSw7AvIg2+HvTMjSSj572mV0i3NLw0eW z4ekCte58liv2kLejeiHjQrgTZDZO/QlUu+GkpITMUzFKt7nPUHBkVz2mwF8gqaBNdey F7yWapCWrHIPWB8+jE37FWdzIfTBra1RbJ/ZNnh3KjiS+3zHnF+MRkyhLlXUXaaLyZ5U PElSHXv2Yb+8WZ3zpnPCaPxh0kzMN6LKIDo/jHaLEzth0eMU4LjCfP81GOwr5Cz90OOE W9Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BnrLZYoY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ot6si12051747ejb.337.2021.03.15.11.23.27; Mon, 15 Mar 2021 11:23:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BnrLZYoY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238417AbhCOOXL (ORCPT + 99 others); Mon, 15 Mar 2021 10:23:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:37522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232750AbhCOOAR (ORCPT ); Mon, 15 Mar 2021 10:00:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ED94464F71; Mon, 15 Mar 2021 13:59:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816790; bh=gKlWR5OD6YJnYAWwJMrB2fhx4cWpWEb+H0/hePFAhBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BnrLZYoYaVlQR20hdgOq6p/mCYP5QIuIP/yOgx1dJc/LjuBw+GT4Ew7QIJF+amuzi 0XR54OHAEGKDJMvEN1H/gutI7X7xPoNX21Yy7Lu9+l8nMT2OekXABy7nWDxTPiu6pL ymxWwWZBv06NRNmmfmhk/+4Ht3EWJym6DwVi1a9U= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jack Wang , akshatzen , Viswas G , Ruksar Devadi , Radha Ramachandran , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.11 126/306] scsi: pm80xx: Fix missing tag_free in NVMD DATA req Date: Mon, 15 Mar 2021 14:53:09 +0100 Message-Id: <20210315135511.924863168@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: akshatzen [ Upstream commit 5d28026891c7041deec08cc5ddd8f3abd90195e1 ] Tag was not freed in NVMD get/set data request failure scenario. This caused a tag leak each time a request failed. Link: https://lore.kernel.org/r/20210109123849.17098-5-Viswas.G@microchip.com Acked-by: Jack Wang Signed-off-by: akshatzen Signed-off-by: Viswas G Signed-off-by: Ruksar Devadi Signed-off-by: Radha Ramachandran Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/pm8001/pm8001_hwi.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index dd15246d5b03..ea43dff40a85 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c @@ -3038,8 +3038,8 @@ void pm8001_mpi_set_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb) complete(pm8001_ha->nvmd_completion); pm8001_dbg(pm8001_ha, MSG, "Set nvm data complete!\n"); if ((dlen_status & NVMD_STAT) != 0) { - pm8001_dbg(pm8001_ha, FAIL, "Set nvm data error!\n"); - return; + pm8001_dbg(pm8001_ha, FAIL, "Set nvm data error %x\n", + dlen_status); } ccb->task = NULL; ccb->ccb_tag = 0xFFFFFFFF; @@ -3062,11 +3062,17 @@ pm8001_mpi_get_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb) pm8001_dbg(pm8001_ha, MSG, "Get nvm data complete!\n"); if ((dlen_status & NVMD_STAT) != 0) { - pm8001_dbg(pm8001_ha, FAIL, "Get nvm data error!\n"); + pm8001_dbg(pm8001_ha, FAIL, "Get nvm data error %x\n", + dlen_status); complete(pm8001_ha->nvmd_completion); + /* We should free tag during failure also, the tag is not being + * freed by requesting path anywhere. + */ + ccb->task = NULL; + ccb->ccb_tag = 0xFFFFFFFF; + pm8001_tag_free(pm8001_ha, tag); return; } - if (ir_tds_bn_dps_das_nvm & IPMode) { /* indirect mode - IR bit set */ pm8001_dbg(pm8001_ha, MSG, "Get NVMD success, IR=1\n"); -- 2.30.1