Received: by 10.223.185.116 with SMTP id b49csp5964061wrg; Wed, 7 Mar 2018 22:47:15 -0800 (PST) X-Google-Smtp-Source: AG47ELtrp/Hag826gzVkbshiSigYowIrzbXW+z0DsfhhEkGOH43gPTsaXRI1i5n6w0IXHr1TRY8W X-Received: by 2002:a17:902:6789:: with SMTP id g9-v6mr23323198plk.167.1520491635365; Wed, 07 Mar 2018 22:47:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520491635; cv=none; d=google.com; s=arc-20160816; b=DqvC7gtymic+lu6qGBi6rPXvsocYgWjREKGUVprbRCiHPRRs4yxrpSJHPMTK79bk2r wr3wSGy4B2x7sVtHSHmrWWJff5bHi9BagBuBYLQDWbWn7YFabgYGhEuyIGUQ2ylrAyRn AduwEMK0LfcTN0uVzaEskQ2lHLAXhMxAVawrumEmuSn4U+FDAGV2cG9OrUPrfXjC7xER L14ILBmQlVE2adilJKoHQ84/9gJR7MGOyEo5SW6EiVpzD9XL8+IUXj1nJDzAeuzoz6f6 1BWnC6W2Vx9eBr4oprgI/jqJ1KuXj6XG56nOG3TgphIxWZ4CkJcSKrUOcoQryDEQ7lmC sAzA== 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=EbtkPQHni5OTrpj0OXDg373OJxOd1PMC75BU7HbkZLY=; b=y0htyLYZEjuY2ibf+zGVC72E5Nv/iciBuC8HlEPJjtErT23WDHnfZbN5L71sn/tgVh cJtsjXM6ESMXD3wLrpw5kghKsspYj7xNW6ocAbghzCYhPjB5y5BGcpKvg6eHFCIfZHY6 Rxh9BHVixoph23W4Acw33yzDBNAUZabTq8R8ED7P45RAzPx0YGSlJ5IdDboHsQwIMsW4 P0K+SvFx0MwHdzABqE3W10ADzMYTb9lRChJtf5E+zUO9tF6L1VxCD0CwQ5q7mD082j8/ IYzsjyus9GJ1ow8FKmOQQZXgZA4q9lLC8xAP0cZ/KegHpHmSNjC16cjK+/gMVnhLydJ3 NcpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=cY9M/Nh4; 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 p3-v6si14118842pld.545.2018.03.07.22.47.00; Wed, 07 Mar 2018 22:47:15 -0800 (PST) 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=cY9M/Nh4; 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 S935328AbeCHGpw (ORCPT + 99 others); Thu, 8 Mar 2018 01:45:52 -0500 Received: from mail-by2nam03on0101.outbound.protection.outlook.com ([104.47.42.101]:17968 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965134AbeCHE6Y (ORCPT ); Wed, 7 Mar 2018 23:58:24 -0500 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=EbtkPQHni5OTrpj0OXDg373OJxOd1PMC75BU7HbkZLY=; b=cY9M/Nh42a5WE+hbVuxAioDQY0ECBn6we+x8FnehL8fGokbHCyE5/zIiPxvRLXYajeos1sKskh25VK8jm+wPoiQNjyZkfD2maE1aGH728QD5AlNqQL/aaOqpE/WEk5wadcirhLThvgnFOtKLJgthgj/R1K6VWUoj92I5FnG+Imo= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0808.namprd21.prod.outlook.com (10.167.110.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.1; Thu, 8 Mar 2018 04:58:18 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0588.008; Thu, 8 Mar 2018 04:58:18 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: "Liu, Changcheng" , Ulf Hansson , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 29/67] mmc: block: fix logical error to avoid memory leak Thread-Topic: [PATCH AUTOSEL for 4.14 29/67] mmc: block: fix logical error to avoid memory leak Thread-Index: AQHTtpn+QIfN8D6xnkS4R0+IqOgxiA== Date: Thu, 8 Mar 2018 04:57:44 +0000 Message-ID: <20180308045641.7814-29-alexander.levin@microsoft.com> References: <20180308045641.7814-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045641.7814-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;DM5PR2101MB0808;7:6ont5woyEFcSRHKdQJ9PG8QKbSq2fMhReOjV+ARb1977JrbO4nnDb3e8FQkhhUIBmbg5jQn65sqiPF6rZyOVLJWi+2TbHso8YftMq3iBYzCE3QODeexkE/yLCs2nKgdlapLbCX10S3AjSP/gkPo2U2tKh/RdR/Pdg1M+ucVVpYNtc4cIFuSF5XcoO/8aaffIS+Wka7BV/v3xM0TMNjc0PMxUY6zxIH5OhUwzh+lYKMEXMSUFZ/eQuMHg7MT1qBVx;20:BXlrtkZRYdqhAbYWX/nfvpm6rxnO9aWQuipvxPFRj6N+3LNuadPrWVO3/3n9QERIiAfKCkORsEjn5cpFKl9A6M5lfcCPk86xkG2ZFbBxF3FxwagxzNn55K3l5DCzAd8E+S2yT65ANtqW7RjvluEXD/LqUY7XgkNlPVvV9CJoCIg= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: e59d6c8a-0823-4ceb-a207-08d584b13548 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0808; x-ms-traffictypediagnostic: DM5PR2101MB0808: 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)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231220)(944501244)(52105095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0808;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0808; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(396003)(39860400002)(366004)(376002)(346002)(199004)(189003)(22452003)(99286004)(76176011)(2906002)(105586002)(3846002)(86612001)(478600001)(72206003)(14454004)(2900100001)(8676002)(102836004)(68736007)(5660300001)(316002)(6116002)(54906003)(26005)(6506007)(59450400001)(1076002)(86362001)(36756003)(186003)(10090500001)(110136005)(106356001)(4326008)(6512007)(6486002)(7736002)(5250100002)(3280700002)(3660700001)(2501003)(6666003)(81166006)(2950100002)(305945005)(53936002)(107886003)(8936002)(6436002)(81156014)(66066001)(25786009)(10290500003)(97736004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0808;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ETP2WxGPytrBhAhyfIN9zfW4M7WXjl4YUiSUk+EgQ2K6E8jZ7rzkiamco69+HnynnQ1+3WCfcdtdq7N45Il0wZbhpUceroCzYIUw00EWyn2Po0PhYqcuwgD2GrdVFzOCxNwuwiexJmaqpKxtXDq+MbSvrbJkADC4dQuTkgOYGETg1Jr7ezIwCsBd5zo1BTNJERVeS39jh2uPpMFB58gSLd1Bgseg16/pqkSGfBeBg6KCnETCei7GsFOS4G5mpdGUNxboDrLoc+YuuatauH9SxLz98AMQ8a80ojN/u8L/P0HKz6uzcb+t/5JjfFy167eOMBNFivSGnexjH9WEScnocg== 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: e59d6c8a-0823-4ceb-a207-08d584b13548 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:57:44.2857 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0808 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Liu, Changcheng" [ Upstream commit 0be55579a127916ebe39db2a74d906a2dfceed42 ] If the MMC_DRV_OP_GET_EXT_CSD request completes successfully, then ext_csd must be freed, but in one case it was not. Fix that. Signed-off-by: Liu Changcheng Acked-by: Adrian Hunter Acked-by: Linus Walleij Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/core/block.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index ccb516f18d72..9c6f2ce3b710 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -2387,6 +2387,7 @@ static int mmc_ext_csd_open(struct inode *inode, stru= ct file *filp) =20 if (n !=3D EXT_CSD_STR_LEN) { err =3D -EINVAL; + kfree(ext_csd); goto out_free; } =20 --=20 2.14.1