From patchwork Mon Sep 21 16:27:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 263587 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9B4CC43465 for ; Mon, 21 Sep 2020 17:00:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9EB7E23787 for ; Mon, 21 Sep 2020 17:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707606; bh=iW7SGnrfadHKhWqhCj6r9zF7flddMAv36Lz03IPT0Hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KytQVWLCSmZKj4UTztV227wxXJjGvyZ8cS2os5Im+F1KHb1pcSPAaT/8sqag0zxm1 gnqOov5dIdNOwX3QQeROjcIrcVzvYQJtKxSF4hZnaVq56HYeSBA7UmHBQV2F52Zeyn +6qjahuLqiVQYdZ8mvhj4Gbjjp7srXbvGG1BZA9s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729432AbgIUQ74 (ORCPT ); Mon, 21 Sep 2020 12:59:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:43924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729377AbgIUQkv (ORCPT ); Mon, 21 Sep 2020 12:40:51 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 660832067D; Mon, 21 Sep 2020 16:40:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706450; bh=iW7SGnrfadHKhWqhCj6r9zF7flddMAv36Lz03IPT0Hg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CpYGinWc0ZwAHiai13kvGkLaixNkrcTmOtiI0JsF80EeTK9mDIGGWpsGjrYHb1nOf wiXqHZTqF+b+sYvlV5QXA6J/MmjdNI1029TuEKQ0BgXkRlrr6S07+vd90Zd6JCnJAL 7OHM39TStqfrW+fDBs/cLXruJuaQx1zfuuRpdr38= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jack Wang , Dinghao Liu , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 10/49] scsi: pm8001: Fix memleak in pm8001_exec_internal_task_abort Date: Mon, 21 Sep 2020 18:27:54 +0200 Message-Id: <20200921162035.126920567@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162034.660953761@linuxfoundation.org> References: <20200921162034.660953761@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dinghao Liu [ Upstream commit ea403fde7552bd61bad6ea45e3feb99db77cb31e ] When pm8001_tag_alloc() fails, task should be freed just like it is done in the subsequent error paths. Link: https://lore.kernel.org/r/20200823091453.4782-1-dinghao.liu@zju.edu.cn Acked-by: Jack Wang Signed-off-by: Dinghao Liu Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/pm8001/pm8001_sas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c index 5be4212312cb0..ba79b37d8cf7e 100644 --- a/drivers/scsi/pm8001/pm8001_sas.c +++ b/drivers/scsi/pm8001/pm8001_sas.c @@ -794,7 +794,7 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info *pm8001_ha, res = pm8001_tag_alloc(pm8001_ha, &ccb_tag); if (res) - return res; + goto ex_err; ccb = &pm8001_ha->ccb_info[ccb_tag]; ccb->device = pm8001_dev; ccb->ccb_tag = ccb_tag;