From patchwork Mon Sep 21 16:30:48 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: 263634 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=ham 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 D14ECC4346A for ; Mon, 21 Sep 2020 16:52:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82561206DC for ; Mon, 21 Sep 2020 16:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600707177; bh=9DiVjW71ekwEdibZggUMrhbwn3fZDsgJ9O9o97eQizI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vxUevazPck2bZPDBVTjO5agZ0kihFrIfrreWt+1oRFZNaWEdiHzlC6GvLZWSkYIxA sSHiSfJ064iQNSitgd0sE5P7FvKxFlykYNAwZceW7kWi3pt4JiICSmny2o2Z3lRK8s 7TI3BYi6c+raq2aoT7GTX8ZPrmme+M5IKp/h9Vlo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730123AbgIUQw4 (ORCPT ); Mon, 21 Sep 2020 12:52:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:56112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729848AbgIUQsf (ORCPT ); Mon, 21 Sep 2020 12:48:35 -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 857FD23888; Mon, 21 Sep 2020 16:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706915; bh=9DiVjW71ekwEdibZggUMrhbwn3fZDsgJ9O9o97eQizI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KjoR9SjQ5Z/06uysczFA/DyBj+KhJA2+j7gKTQOz4APQgy70MrAoyGSkFwfwih5bi dKElZgscNXniAC61jLvKaR7EDub+DeEUGj3OqaOr05+Ev+pSu4gHtASROgnu1Xhlu2 /6J9Lu1x27MFDn5NsZk4QvlquUMC+KFeLx1S8w78= 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 5.4 09/72] scsi: pm8001: Fix memleak in pm8001_exec_internal_task_abort Date: Mon, 21 Sep 2020 18:30:48 +0200 Message-Id: <20200921163122.322814447@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921163121.870386357@linuxfoundation.org> References: <20200921163121.870386357@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 7e48154e11c36..027bf5b2981b9 100644 --- a/drivers/scsi/pm8001/pm8001_sas.c +++ b/drivers/scsi/pm8001/pm8001_sas.c @@ -816,7 +816,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;