Received: by 10.213.65.68 with SMTP id h4csp44142imn; Mon, 19 Mar 2018 19:00:33 -0700 (PDT) X-Google-Smtp-Source: AG47ELtjdqPRJyY7NgQ34PvD13nVxeZ/nB1/u2DZgxIKTPx1aJULBohTYU9Qm3EIRoK30wV22N+C X-Received: by 10.99.120.3 with SMTP id t3mr7235480pgc.56.1521511233443; Mon, 19 Mar 2018 19:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521511233; cv=none; d=google.com; s=arc-20160816; b=OrqTbRmjDURTtj80imGvZMnAc1IHuiTzGoHeJ3HWUgMyw+ClhmoIhRGdB3NO/O4VN/ jbtvJj1Vx06tjqIIZMmzqG/3ms096DN1ecllDnXYXU+GULFPhSLleCG6fo5DhJulyd4n Y3FxIp92Xbi2NXCVAQ4q/ZpW1r7iDn7O8fNuUgmPXXxEd/GBw95eZQNTjdEQSoOdAFW4 xfKV30shujSvFLsLFMegpuQYNJQFMSayhQXWvw1BdmbSM9NQNSnf94q4aJ1NHJygFz8E E7hjApTlV+gmQ2HDrMUTiPnELHzd+Pld+Qj8CQR7yTjD27A0IgOCL8iqqdiEoH2GSXdQ Y+IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=GD24aP8vtXqy7xv8Tzb4cGadZo/reSU1FZRAJ0bMZvk=; b=wUx+sPwnyBE+B6zwZZv3DMWPWwelj5wMzmD+PjC5OWkZLvLYt0GiLT29Jkk1PiNeVV 3hP2eeIVtBF3uwBzOxkimC2WAenTRzFQ8iJffy4/YDa0afwOROFS5/XyQDhQwxqI1AjG iubjGhvenLCUG2PiB+YR9AZ2D9IQGewrLilLhQUjfNXNJ1MhH3rb8mc4fwxGTxOXu7Ra 4HyUuXPjbFhA3BtLIaGJS+UHlCGg26i6tPMTRu0Ou3MzkAzL90/iVNcYb7rqbgm2Q9Xn g79/NAAeK8HzuhUVyM9b13WPF1bD6Og3a+2QcWsO4o5WFQJm/88b8XC7pk0gMG3oGNZD wgzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Wq/H13Ir; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a4si384655pgd.452.2018.03.19.19.00.19; Mon, 19 Mar 2018 19:00:33 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Wq/H13Ir; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936403AbeCSWTf (ORCPT + 99 others); Mon, 19 Mar 2018 18:19:35 -0400 Received: from mail-cys01nam02on0096.outbound.protection.outlook.com ([104.47.37.96]:43108 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933958AbeCSPt0 (ORCPT ); Mon, 19 Mar 2018 11:49:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GD24aP8vtXqy7xv8Tzb4cGadZo/reSU1FZRAJ0bMZvk=; b=Wq/H13IrlqX/q6Pl4PzCmlqc67h+FmbA87jMz3+t8QL4NLcbobwlDQMcyfBq1GuT9+PqFnBqSx5TNDCnNF4iS9UtIt5lLYz635cN6r0urjzycxd4uhAV5gCrKscBRaX4yzwDhcYpVzBISr8eS0Ixlul1FxIjHM/LAu9N3oMFJng= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0919.namprd21.prod.outlook.com (52.132.132.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:49:04 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:49:04 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Jason Yan , John Garry , chenqilin , chenxiang , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 087/124] scsi: libsas: fix memory leak in sas_smp_get_phy_events() Thread-Topic: [PATCH AUTOSEL for 4.15 087/124] scsi: libsas: fix memory leak in sas_smp_get_phy_events() Thread-Index: AQHTv5m+yBMupBH1pE2uKsMJ+ZeIsw== Date: Mon, 19 Mar 2018 15:48:36 +0000 Message-ID: <20180319154645.11350-87-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0919;7:snXpWGkdVnqnFXtwr+LK6kzyvJnH3gEfTWs+8GVUNJ8nONBzIV9n+eFbJPNNYytuyycic3L2nQN3TXod5nOPcurDeAUbkyeumCzD4G/5BRq99SVdO6lu3XgF0XAXpIiulsUL+QUlWjzvpuFleAQqOWr+vU8BHM6NId9wsLQN447xW3NgnaDlj175LJdH3emki33i9I5x8zZHhjYrl0uwQAYrr4EVRB4DlevCeWQ637jFP+7SLzucuI2G9KdPJE9R;20:kmtxtyzgn5bJsNfIB90aUMPpljHRy3ZUlr5UPuWgAYyCC3UJYDSwTKQi79Vzi/1TanHA0/Cp1kF9I9ZndOZ4Il3hPfn++yVE6MZhGVFtFHSaYPDZNLZkXburKXbwpa50sS1v7j2nIKw+tncaRw8LR4ewdc1GKdbvEFYf8dXqno4= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ee48d880-aa6b-46dc-1f29-08d58db0f15a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0919; x-ms-traffictypediagnostic: DM5PR2101MB0919: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(50582790962513)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0919;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0919; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(366004)(39860400002)(396003)(39380400002)(346002)(199004)(189003)(6512007)(5250100002)(106356001)(99286004)(102836004)(2501003)(6116002)(1076002)(3846002)(186003)(10090500001)(76176011)(6486002)(25786009)(316002)(26005)(22452003)(68736007)(6436002)(2900100001)(54906003)(2950100002)(6666003)(72206003)(81156014)(3660700001)(4326008)(7736002)(110136005)(305945005)(478600001)(3280700002)(6506007)(97736004)(81166006)(8676002)(10290500003)(575784001)(66066001)(2906002)(86362001)(105586002)(8936002)(53936002)(36756003)(14454004)(86612001)(5660300001)(107886003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0919;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: MXo6+EKIYmSxn3JewNZenuCRczV5d4r6COMeiUPz+zLoJcPDxpSRxPsPM2/a9/o9ZL35/aZrDhGgX8bHi6gKGBc8CURyyFKQzgtrA6D3AfajiTPR5IrpZwRh+t6UxD/qtMG0I7V624gE7v8NnwtDXRXy/T989tsZamHiqfwNPH8w7XJu0rgbCFOAwP4NSOOigpQh2JsI6fS+8xqtFAalDNqoDC191TUa5UzGbaXKwf2zxrJSoyoHV/7pln3/hPaGxZZCtW9Ivi6r0kcI7jMD/W9jbh3ueA77KvF8A0kzsv3+GEbbQ6kMSlR0qyr3HfOcyAHj0CeGAimjonksVMvb+Q== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee48d880-aa6b-46dc-1f29-08d58db0f15a X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:48:36.4332 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0919 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jason Yan [ Upstream commit 4a491b1ab11ca0556d2fda1ff1301e862a2d44c4 ] We've got a memory leak with the following producer: while true; do cat /sys/class/sas_phy/phy-1:0:12/invalid_dword_count >/dev/null; done The buffer req is allocated and not freed after we return. Fix it. Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") Signed-off-by: Jason Yan CC: John Garry CC: chenqilin CC: chenxiang Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/libsas/sas_expander.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_e= xpander.c index 3183d63de4da..4b0c67ff35c5 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -695,6 +695,7 @@ int sas_smp_get_phy_events(struct sas_phy *phy) phy->phy_reset_problem_count =3D scsi_to_u32(&resp[24]); =20 out: + kfree(req); kfree(resp); return res; =20 --=20 2.14.1