Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3300406pxk; Mon, 21 Sep 2020 10:03:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmXOozf5ICkNAmlvV57wQdL/9tchwlRZZBld7RT9Eir6ropIQm2CIVn2uC8hxcvaqmxLXA X-Received: by 2002:a17:906:46c9:: with SMTP id k9mr441473ejs.38.1600707807052; Mon, 21 Sep 2020 10:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600707807; cv=none; d=google.com; s=arc-20160816; b=cPmQvwCe4wH3JatzHlCL0v7e/Zn3wUB9S7am8eoxvKi5M12I+6vJRR3cxhQ6/DVx+W /FKQJlsB4fEjdm5gTHtM4wSiU2qPWb5s12Q2weyeB1/O56PnCwhKF+EPTFpBPHabvajU hY7eLojc/2u4aDaEyJ/fvESm1UQL3ntHGWVlf6D7kJGVBnT3VP5aS3X6Dz54RHlsXZez A4oMylOzt7V3gAgC4rg91yHwWglK16RZ+VyXKLbLZLUzDRbILOWeWzTc9nypWm/fUlCf WyJTGWFBR3BpSlyrSUNrDrVYPuom1OzWY9b9289LTYSqOnf1QqADRpyLrQjKQP9cF7r2 z/3w== 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=VZHjlGs2E3/4/iUdxdkFAwd8hvS/ORK9J+nHq2AsLts=; b=C5/sWjdWe/9zQ0OLMWrrnJtSlmN69eRhjEBmt82Zs+dk73lLnxqp+qFb2AOIw17xKy Q3adwpRhfE/b+8MjXbpwoKCsZgq7I/iuv8xyZ4szbBJoAvBfapCdO8WONGJzuUVrTcLF c5iL6pubc6HvPPdD41yeHXFE48cijE7K0oqqL9XKRuFD23uHSI8zwXuBMnXlM7RQkuW/ ZXCmrFfYYSp6f8Ds1AiiPjtQStVc6drssrbaqFg5+4JhmG9lDzCk75OwAQntNkEi1irl 9EghUvwJI3LhWtyteEo8Ydxs19OlBR1fZLXR3kZgvnvUAUQn3giIzMJR8fAJW9aA618p 60Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w+ERLZt+; 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=fail (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 d17si8357930edx.591.2020.09.21.10.03.03; Mon, 21 Sep 2020 10:03:27 -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=@kernel.org header.s=default header.b=w+ERLZt+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730391AbgIURBn (ORCPT + 99 others); Mon, 21 Sep 2020 13:01:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:40810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729228AbgIUQjK (ORCPT ); Mon, 21 Sep 2020 12:39:10 -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 C0C5F238EE; Mon, 21 Sep 2020 16:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706349; bh=PQSAbPp/SO39R20BoR+qN6FK+isHUo3NjRid7Kpzh9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w+ERLZt+oDhiT/gneu4HA2ygVqvC5HJDb5yQ/cHhHk8w91rAVihDKZm9VB5osfrVr YA0eEwul58FCwMypMj+OjB2FCEdyqtWq1kDTRIdG9iEkv6GxsszPLWUUatSPFHSHus uxKkrYfehuyB5krjWETpfgCfyOuu8xZ+yEbSQ6SY= 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.14 65/94] scsi: pm8001: Fix memleak in pm8001_exec_internal_task_abort Date: Mon, 21 Sep 2020 18:27:52 +0200 Message-Id: <20200921162038.520595740@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.541285330@linuxfoundation.org> References: <20200921162035.541285330@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: 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 e64a13f0bce17..61a2da30f94b7 100644 --- a/drivers/scsi/pm8001/pm8001_sas.c +++ b/drivers/scsi/pm8001/pm8001_sas.c @@ -795,7 +795,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; -- 2.25.1