Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp378093ybt; Wed, 24 Jun 2020 01:17:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeXN2NxONy1EPMEDUsMLweMVseI/gl50DiDIoObnZ+e3KGPV1C4x1eWyoXc3K2Lb9koBT6 X-Received: by 2002:a50:c88d:: with SMTP id d13mr1205421edh.104.1592986678671; Wed, 24 Jun 2020 01:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592986678; cv=none; d=google.com; s=arc-20160816; b=u4c6DpM/GLNi2DMS9c6+LOhu0Y3XfLDmO2O6aWgI15xX3jDwOoDU3mR8a47hF0gYkC hT8NT1xCAOt33duZeruQ3gkFbtwE1HVKWKZd+QQVMQ1K+3EcxQHvczmPKRTZAM/7qT6i +OojOHVAYoJqrVmn55cLTvXH3T7ra7vm+5oljcSDNVorTfekMcdMCNAEN/4XuJOHT1vn jXXMmP941xv1LOF1mReMzkLPjDzAfkimBpXGx5dhcdEGJHpBWO9FwVaoT3PseOOOxmNQ p0oNrdXJf0kJYeJkXSdfbwBfokJ3MZDiUQQ3Iq5IbgMP6CP7QXrcyBa4StX03ar/MxZw l33g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:cc:to:subject:dkim-signature :dkim-filter; bh=EHndB5QzgamLkOVrkzrSmd1+bAEHOFM//FEnnR45Bo4=; b=ZleIXoK5TSJx956McJTQq3fM1j4O0QPKH5olcL0gp3nV8OFheCNu+/f/suuX7u5Yns Hu4WZiqZ9J9Y6TXtPBScFUtTH0oDIQ7FfsiGwliL1xsJXmWyoFCrItg1oC9iltm4YD3R wyQ2ydLl2FPHQrLkIyTV2/jDHo6dCGcVv0hmUe+cxXbnCw/eF8O4+ws98rrVn7hTPsPq AZyHBN64cpu8F3//SgLRun1ziKPS6KQtloifeuFlrn44k4U8do2kJTpozshissXCLIv8 pP6B962jRAYJKnk1T7YkUtYqBDaE99ct/oQlXwHKq0El87i74aU4pWS2cKHi9fbA9hGC PpsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Ttjv3W55; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do16si15460361ejc.166.2020.06.24.01.17.19; Wed, 24 Jun 2020 01:17:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@samsung.com header.s=mail20170921 header.b=Ttjv3W55; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388906AbgFXIQP (ORCPT + 99 others); Wed, 24 Jun 2020 04:16:15 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:52790 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388048AbgFXIQO (ORCPT ); Wed, 24 Jun 2020 04:16:14 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200624081611euoutp01537180a859292b0c073d831d2b55e9ad~bbNi2URUA1103511035euoutp01S; Wed, 24 Jun 2020 08:16:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200624081611euoutp01537180a859292b0c073d831d2b55e9ad~bbNi2URUA1103511035euoutp01S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1592986571; bh=EHndB5QzgamLkOVrkzrSmd1+bAEHOFM//FEnnR45Bo4=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=Ttjv3W55vyImYB59xCPQGIkn8zbRLXBGasQGUJiz/6sVRQB/SP1QXjVJV0rckcjIA DzXxc/v4LaHLIL3c/8BbMl1q6vOp/OqLyPvixrG6e7B85XhSnhZ0nQBi0A7oVwzy0v fSncipZy8duCvq/9fJ6GPWB8OH792pT13dKUEuTA= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200624081611eucas1p226b8963e5ae702345134f941d6b96727~bbNisDFHe0174401744eucas1p2H; Wed, 24 Jun 2020 08:16:11 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 86.DD.05997.ACB03FE5; Wed, 24 Jun 2020 09:16:10 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200624081610eucas1p1fb83289f3916bf59400b2ea737c124d1~bbNiOoyMc2767127671eucas1p1U; Wed, 24 Jun 2020 08:16:10 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200624081610eusmtrp1ab30ef185830ae9fc608a966fd014c18~bbNiNZNoB3260232602eusmtrp1X; Wed, 24 Jun 2020 08:16:10 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-3a-5ef30bcaa20a Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 67.73.06017.ACB03FE5; Wed, 24 Jun 2020 09:16:10 +0100 (BST) Received: from [106.120.51.71] (unknown [106.120.51.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200624081608eusmtip1aca323a1e91aaac71dd2e364feb4b059~bbNgn-YNL1894018940eusmtip1J; Wed, 24 Jun 2020 08:16:08 +0000 (GMT) Subject: Re: [PATCH v4 01/11] acpi: thermal: Fix error handling in the register function To: Andrzej Pietrasiewicz Cc: linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, "Rafael J . Wysocki" , Len Brown , Vishal Kulkarni , "David S . Miller" , Jiri Pirko , Ido Schimmel , Johannes Berg , Emmanuel Grumbach , Luca Coelho , Intel Linux Wireless , Kalle Valo , Peter Kaestle , Darren Hart , Andy Shevchenko , Sebastian Reichel , Miquel Raynal , Daniel Lezcano , Amit Kucheria , Support Opensource , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Heiko Stuebner , Orson Zhai , Baolin Wang , Chunyan Zhang , Zhang Rui , Allison Randal , Enrico Weigelt , Gayatri Kammela , Thomas Gleixner , kernel@collabora.com From: Bartlomiej Zolnierkiewicz Message-ID: Date: Wed, 24 Jun 2020 10:16:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20200528192051.28034-2-andrzej.p@collabora.com> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02TbUxTZxTH89x7e9syyi5F7BO2xaVxMzMT3NzYiaLRwYf7bX5Uoow6bpBI q2uhTGUbkvHWKeMlglZ0KMa+oBsWKBSQELrJsFLBZagbb1VAcJa3diIOytpeyPj2O/9z/s// nA+PiJSWCKNEaaoMTq1SpMvpEMp6e8G55c5rnqStvvE4MP3mo2DeuUDAtSdDFJSdWybh5ikX AZc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gcrdjW9qRs014XJn9gF72JekNG6tiMtKDuKxovSasZs7FvSX s++EDpW9ZoNAyuh0nauV0yoZsVCn3kkbRd1z33/Dy7QDAAA= X-CMS-MailID: 20200624081610eucas1p1fb83289f3916bf59400b2ea737c124d1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200528192122eucas1p29d209ad5a885b31deb04dcad13f98ad5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200528192122eucas1p29d209ad5a885b31deb04dcad13f98ad5 References: <20200528192051.28034-1-andrzej.p@collabora.com> <20200528192051.28034-2-andrzej.p@collabora.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 5/28/20 9:20 PM, Andrzej Pietrasiewicz wrote: > The acpi_thermal_register_thermal_zone() is missing any error handling. > This needs to be fixed. > > Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Bartlomiej Zolnierkiewicz Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics > --- > drivers/acpi/thermal.c | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) > > diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c > index 19067a5e5293..6de8066ca1e7 100644 > --- a/drivers/acpi/thermal.c > +++ b/drivers/acpi/thermal.c > @@ -901,23 +901,35 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) > result = sysfs_create_link(&tz->device->dev.kobj, > &tz->thermal_zone->device.kobj, "thermal_zone"); > if (result) > - return result; > + goto unregister_tzd; > > result = sysfs_create_link(&tz->thermal_zone->device.kobj, > &tz->device->dev.kobj, "device"); > if (result) > - return result; > + goto remove_tz_link; > > status = acpi_bus_attach_private_data(tz->device->handle, > tz->thermal_zone); > - if (ACPI_FAILURE(status)) > - return -ENODEV; > + if (ACPI_FAILURE(status)) { > + result = -ENODEV; > + goto remove_dev_link; > + } > > tz->tz_enabled = 1; > > dev_info(&tz->device->dev, "registered as thermal_zone%d\n", > tz->thermal_zone->id); > + > return 0; > + > +remove_dev_link: > + sysfs_remove_link(&tz->thermal_zone->device.kobj, "device"); > +remove_tz_link: > + sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); > +unregister_tzd: > + thermal_zone_device_unregister(tz->thermal_zone); > + > + return result; > } > > static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz) >