Received: by 10.213.65.68 with SMTP id h4csp1617608imn; Mon, 19 Mar 2018 08:52:44 -0700 (PDT) X-Google-Smtp-Source: AG47ELtZVAi5eD0sPGxP4j5hMEWtFSna9Nwg28w70b1pfnVksOjqy+ubjKSKrJy5xU7p+1dOJy9L X-Received: by 2002:a17:902:6b81:: with SMTP id p1-v6mr13100345plk.181.1521474764602; Mon, 19 Mar 2018 08:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521474764; cv=none; d=google.com; s=arc-20160816; b=YhjSc8XRZtOzbDHhEkGt84RGt6yyRzNLNcTQTu2LmlVuBNluS5e9YaH+dzDSM+QOHW 6ymHcarpyOf85/slCLB9l85dYRwJBSLofj6wkVZHIhFEgegwfFszxHiNiGCTjmjw9geW /EXvRa9XUhfOKCN4191J0YmJdkOgj0V8UiKZ86ah3gllHgVEmeFsipLJJpHMwM26/5cp D8OGr0AzBdTdIAgO7O7ILurKmWg4w9y2rQVNPXjHqIAR8qdTmBgUpY3PFloBj7JLR9OE xYcubpurHIj50fxranS9rlYtPoQTJIGuL3eMrQauZSZ1vHTW75uZLTNCCfJUpehxyeim dFqQ== 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=aicwdnSwCjOUP/UysK+W0AgICeNttFqemYnRaTP/lv4=; b=lO60+mxXwdiN+F/PYhZnk0UwddJEByKnnCe0luhMNIrSYRgBG7/n066yefDfCmt+lD Ez9aAra7NJ6p/mB4Lgg/IBnRbktGMMdH433kKQhWrKqJJF/EKfzN7e9F28kxr5GsegxW c1nn0G+F2/rvflUjGRbgrEPP2RGNCJqz0W/ey2P75Q2M5fw6SZgC/cDXGHWf24tzyiF8 stCBlkxzS4ZViXTw3ihbR+QqRjG8EUlGwKHe2izBpHgwoPchiXKyIMUBZrpSLAt7Oore w17FPgQnHwLMvRw30InQtcHtEJ13oxk+J1dCWzCq0tWy39HUL2SpJPzM565wSD/Fihpx 2loQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=iRoPagdX; 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 x4si160116pgv.315.2018.03.19.08.52.30; Mon, 19 Mar 2018 08:52:44 -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=iRoPagdX; 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 S934179AbeCSPvD (ORCPT + 99 others); Mon, 19 Mar 2018 11:51:03 -0400 Received: from mail-bn3nam01on0104.outbound.protection.outlook.com ([104.47.33.104]:63552 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934088AbeCSPun (ORCPT ); Mon, 19 Mar 2018 11:50:43 -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=aicwdnSwCjOUP/UysK+W0AgICeNttFqemYnRaTP/lv4=; b=iRoPagdXkvTKFeSo0ciIdXjkztHiKjj/HME0ilYDLpkuAjhP7dFUVaEjBWfRh8xtsqAqb/72EzSxPKTN3Ktmne8kz/G+GVdb6mhHMOTCJ8GGFAB+5RYk1dwItZUDkpZb9yTPEaGPhTM9p/w7Y8DZTY/+0MSkUNcjbUEzNwPUd9I= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1063.namprd21.prod.outlook.com (52.132.128.39) 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:50:39 +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:50:39 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Alexey Khoroshilov , Zhang Rui , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 124/124] thermal: int3400_thermal: fix error handling in int3400_thermal_probe() Thread-Topic: [PATCH AUTOSEL for 4.15 124/124] thermal: int3400_thermal: fix error handling in int3400_thermal_probe() Thread-Index: AQHTv5nZ9HjMQTXqo0O4cDCfIDQdVw== Date: Mon, 19 Mar 2018 15:49:21 +0000 Message-ID: <20180319154645.11350-124-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;DM5PR2101MB1063;7:rX1jxPGCJLPFxCbxBSlxal+w69I5H5v6pdMqZLwJloVncRWYtSckE960rhGNxK1PLumAXzh4491E0Siz6kkjgT4WTSbY3NtHOCT6aeOrzj8X2zRea7rXBj/+qcEMO07aSxnemkmXgeNQ3K0m7O6iIeuJXOZcsjNKjanu9E4wUT8J+Xe3uwtntzs04XfTRscsaadpK46w4YKNDybODqd3V0Sa6eO6ge3Rgbbv+M4qYVbz9CgoDq9Sz/byJdYPWe8F;20:RqxDB4TuKpEL35GBt+7h0ZZFEzqUzpprmfec9gbjJxoRVD1DVPyI0prFK8Kdl/eehjSUxksiLINA79tAnx7Zy3ad2nsZrz00GMGQlMkdQYVaVV/+phtSBlfGPULXfdnmPzfHr2eDCnitJiFozbuXNxlym7Y6ncBPcuL3mu3mnus= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b6a75b68-651e-445a-b65f-08d58db129dc x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1063; x-ms-traffictypediagnostic: DM5PR2101MB1063: 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)(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:DM5PR2101MB1063;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1063; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39380400002)(39860400002)(376002)(366004)(346002)(189003)(199004)(10290500003)(68736007)(110136005)(478600001)(72206003)(36756003)(99286004)(97736004)(10090500001)(305945005)(7736002)(6666003)(15760500003)(2950100002)(107886003)(76176011)(26005)(6436002)(86612001)(54906003)(6486002)(4326008)(186003)(3660700001)(25786009)(53936002)(81166006)(2906002)(2501003)(81156014)(5250100002)(86362001)(2900100001)(5660300001)(8936002)(6116002)(8676002)(1076002)(3846002)(3280700002)(66066001)(316002)(59450400001)(6506007)(14454004)(106356001)(4477795004)(22452003)(105586002)(102836004)(6512007)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1063;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Yj6DRJg70pswhS9gyqiviC91iYkzI4pUNq0GtvNff72CarEW5z1uzyO2x5OdJ5SwVaYlHjmd3K5/KbwkuOd+Hn1FHFZEQHKiEHmTQegY1WVVNkRY4gkSlyoC+QFh2Tv1DhXY8f+3ybSXjLkKVG4krzcURL1DwT1j0SRXzv18stvQwoCw5s0FSmNa2PtVynH+sez00QEtG399TrFB3xE5P9OueoWzBIGSUpoYUQY00HZzQi0DcRbq+aRZczE90nKxgD2kngHY8i/OroC7InSdR2iXa2Agu1DanvUNx3ncEHzhv1y9uhJ4wPpsQ/XC9XnG3mJh3ttkKQK6ZWNK+lL6CA== 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: b6a75b68-651e-445a-b65f-08d58db129dc X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:49:22.0020 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1063 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexey Khoroshilov [ Upstream commit 0be86969ae385c5c944286bd9f66068525de15ee ] There are resources that are not dealocated on failure path in int3400_thermal_probe(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Signed-off-by: Zhang Rui Signed-off-by: Sasha Levin --- drivers/thermal/int340x_thermal/int3400_thermal.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/int340x_thermal/int3400_thermal.c b/drivers/th= ermal/int340x_thermal/int3400_thermal.c index 8ee38f55c7f3..43b90fd577e4 100644 --- a/drivers/thermal/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/int340x_thermal/int3400_thermal.c @@ -319,17 +319,21 @@ static int int3400_thermal_probe(struct platform_devi= ce *pdev) =20 result =3D sysfs_create_group(&pdev->dev.kobj, &uuid_attribute_group); if (result) - goto free_zone; + goto free_rel_misc; =20 result =3D acpi_install_notify_handler( priv->adev->handle, ACPI_DEVICE_NOTIFY, int3400_notify, (void *)priv); if (result) - goto free_zone; + goto free_sysfs; =20 return 0; =20 -free_zone: +free_sysfs: + sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group); +free_rel_misc: + if (!priv->rel_misc_dev_res) + acpi_thermal_rel_misc_device_remove(priv->adev->handle); thermal_zone_device_unregister(priv->thermal); free_art_trt: kfree(priv->trts); --=20 2.14.1