Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4489878rwi; Mon, 17 Oct 2022 07:01:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6O7Fu+V3CsQg8z4tYOzuX6nUz6T2yMwuq57Q7sT/QufQ4yBFvu82vNxSvxBUPuv1ZM8Gqz X-Received: by 2002:a17:907:7250:b0:791:9093:47f7 with SMTP id ds16-20020a170907725000b00791909347f7mr4543036ejc.278.1666015276603; Mon, 17 Oct 2022 07:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666015276; cv=none; d=google.com; s=arc-20160816; b=D/qDdXcjMDeMHneWqsR/jhzvy5YHiWpagdmo1GA5oXZQ02zObZNqHkDHdMVnBHBZsj 1d8zqFCEYzxVkoGARyzvPM78qJX9I0qoUd3jumaCqec2zWWIU9lV9+htfyP2cbbE0wnC HNRtVPJ2hb/KRU+C8AozZhtsUTge6CnvL+z1odz2cb+xYTRXbYbliR9tnRNLyz8t8+O4 PzIcNOP5UC43bnQr8MO20VzhoTH7Z2AARlXCaZiEjRbKtM33+WwY27x/m4K5a8RwXD6R RwDJf5qvuUa4800g3oWKtjC3SvEgEXXtMfqMIrQ3czMjkabAP1KPZ6VVggs+xhBAxyfU Svxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :in-reply-to:from:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=1EbOIh3VRPIcp6I0IzAFx4YxCbdHwGU6CMVd3ePZ8QI=; b=u5Oy9ocivFGoot7EUn695dsF6QXU3J5wYV6TieiVoEAXYefAGFgSBFhIP/mfB3wch7 bu3rMJd2hqR3RCG3vLSEdN2Sji750kSbRsZ7pypKrrII9JTxBeddrrH7yopvqCEoghMZ n3cKTMNnHG9CVM2S4i1tNWyX5RQ52pbyUoCeri2qijX11A46Nx48lYACgLEQfvcr/cD7 HNXCYOrT1NQpk5uinjrCLR/4mMv7MOjv5bjklBN17gn+DcT8+6xs2fGET8gw/sdOvSL1 odnb5Ar8il9Hkdz5xP36NPe/mDT/urQ7Lx+DP0GwnPR68CSGvRbZqbgx48o5JFQybPwP KDpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=nsDpB1C3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa22-20020a1709076d1600b0078b96068bc0si10099593ejc.79.2022.10.17.07.00.46; Mon, 17 Oct 2022 07:01:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=nsDpB1C3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S230059AbiJQNtL (ORCPT + 99 others); Mon, 17 Oct 2022 09:49:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbiJQNtG (ORCPT ); Mon, 17 Oct 2022 09:49:06 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AE9E5F9BD for ; Mon, 17 Oct 2022 06:49:02 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20221017134857euoutp01ae78a8949b8b141ad73a7eddd4238f41~e32UUkzBN2846528465euoutp01s for ; Mon, 17 Oct 2022 13:48:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20221017134857euoutp01ae78a8949b8b141ad73a7eddd4238f41~e32UUkzBN2846528465euoutp01s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1666014537; bh=1EbOIh3VRPIcp6I0IzAFx4YxCbdHwGU6CMVd3ePZ8QI=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=nsDpB1C3inbtn/+xBSMenk13Z/RRhiS6ORDqtUFNLAZS87UCnOsJCfNdhdbOkXJBN C8WanEmd0l6drAJ8rr8kyr7trq9kuXV8GlyR/a4wvtQwOyh74EM3QkhTIEocNOJpw/ UVsunpGFEbgXIt6dt7+RK8GmoINMaPiBSQicaAUk= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20221017134857eucas1p23883fbac8658a6dd56e452003ce125ef~e32T-3qap0593905939eucas1p21; Mon, 17 Oct 2022 13:48:57 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id B3.6E.19378.84D5D436; Mon, 17 Oct 2022 14:48:56 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20221017134856eucas1p12f978192d409c5ada476591d26e90b02~e32TblpSq2786327863eucas1p1W; Mon, 17 Oct 2022 13:48:56 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221017134856eusmtrp177310ba06f98bee9d28eb87d594d7daa~e32Ta2ESZ2870328703eusmtrp1T; Mon, 17 Oct 2022 13:48:56 +0000 (GMT) X-AuditID: cbfec7f5-a35ff70000014bb2-b6-634d5d48a43b Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 57.D0.07473.84D5D436; Mon, 17 Oct 2022 14:48:56 +0100 (BST) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221017134855eusmtip15dcae25ed74f636cc534e4cf1dcc34d9~e32S19qZk1305613056eusmtip1h; Mon, 17 Oct 2022 13:48:55 +0000 (GMT) Message-ID: <1155a694-b821-d41a-da54-8a9656d90e50@samsung.com> Date: Mon, 17 Oct 2022 15:48:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH] thermal/drivers/exynos: Fix NULL pointer dereference when getting the critical temp Content-Language: en-US To: Daniel Lezcano , rafael@kernel.org Cc: Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Amit Kucheria , Zhang Rui , Alim Akhtar , "open list:SAMSUNG THERMAL DRIVER" , "open list:SAMSUNG THERMAL DRIVER" , "moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES" , open list From: Marek Szyprowski In-Reply-To: <20221003132943.1383065-1-daniel.lezcano@linaro.org> Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNKsWRmVeSWpSXmKPExsWy7djP87oesb7JBkf/mFs8mLeNzeLw/AqL 71uuM1nM+yxrsff1VnaLTY+vsVpc3jWHzeJz7xFGixnn9zFZzP0yldniycM+Ngduj52z7rJ7 LN7zkslj06pONo871/aweWxeUu/Rt2UVo8fnTXIB7FFcNimpOZllqUX6dglcGW1TGhgL9nJX PH47j7mBcSNnFyMnh4SAicT6e3fZuhi5OIQEVjBKPFz7lQXC+cIo8aH9LROE85lRYv6vX8ww LQ1fzkAlljNKTLs4gRHC+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W ekYmlnqGxuaxVkamSvp2NimpOZllqUX6dgl6GW1TGhgL9nJXPH47j7mBcSNnFyMnh4SAiUTD lzNMXYxcHEICSxklNj9azAaRkJE4Oa2BFcIWlvhzrYsNoug9o8TK0xvAErwCdhLX371lArFZ BFQlDi3YywYRF5Q4OfMJC4gtKpAisXr1XjBbWCBL4sfEy2C9zALiEreezAfrFRFwlPjydxE7 yAJmgX/MEvtbvjNCbDvJKNHWupMRpIpNwFCi620X2AZOoI4/X3ayQEwyk+ja2sUIYctLbH87 h3kCo9AsJIfMQrJwFpKWWUhaFjCyrGIUSS0tzk3PLTbUK07MLS7NS9dLzs/dxAiM123Hfm7e wTjv1Ue9Q4xMHIyHGCU4mJVEeN2++CQL8aYkVlalFuXHF5XmpBYfYjQFhsZEZinR5Hxgwsgr iTc0MzA1NDGzNDC1NDNWEuf1LOhIFBJITyxJzU5NLUgtgulj4uCUamASCdUtaD4kcnveyc9/ 7k0q/S7O0LhS81Xtrs3R/KJJ0+ROsxr53kw1v/HmhVRIUuXPj2cbdnI8zRAMyVDK0vxj8yOx yqaEo3WGT/bxJrVEj3vF/VIBXXWvo/yPPVuZcVphTnryM6Pdnz5s+pgv7LKlNuT+z4ru1tag matYok9KXGzNdSi2rlcVv3xb+8eBmxvqmS++eDTv+6SjW7bbPJ36dmp83xyX+mUZUra/bJyy 3/6/u8PmrGDSRK0i7jdh0180SbzN2nhw6l8RtzifR1GvAjR2nHU02vP8W1vD5abtDFYqT+fX zHm9R7hZXHC2gZTF44sJS0oEHXLnbG+s11h2LWb2pmPi1TcFPB1O5b1TYinOSDTUYi4qTgQA rC+WC2ADAAA= X-CMS-MailID: 20221017134856eucas1p12f978192d409c5ada476591d26e90b02 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20221003133014eucas1p1fe47bf216e05f96e946c7dcc5fc7eea9 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20221003133014eucas1p1fe47bf216e05f96e946c7dcc5fc7eea9 References: <4e4d873b-4a40-334a-34e7-defb0fcc4e6b@samsung.com> <20221003132943.1383065-1-daniel.lezcano@linaro.org> X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, On 03.10.2022 15:29, Daniel Lezcano wrote: > The driver is assuming the get_critical temperature exists as it is > inherited by the thermal of ops. But this one has been removed in > favor of the generic one. > > Use the generic thermal_zone_get_crit_temp() function instead > > Fixes: 13bea86623b ("thermal/of: Remove of_thermal_get_crit_temp(") > Reported-by: Marek Szyprowski > Signed-off-by: Daniel Lezcano This patch has been dropped from -next, is there are reason for that? > --- > drivers/thermal/samsung/exynos_tmu.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c > index 5a1ffe2f3134..37465af59262 100644 > --- a/drivers/thermal/samsung/exynos_tmu.c > +++ b/drivers/thermal/samsung/exynos_tmu.c > @@ -264,9 +264,8 @@ static int exynos_tmu_initialize(struct platform_device *pdev) > unsigned int status; > int ret = 0, temp; > > - if (data->soc != SOC_ARCH_EXYNOS5433) /* FIXME */ > - ret = tzd->ops->get_crit_temp(tzd, &temp); > - if (ret) { > + ret = thermal_zone_get_crit_temp(tzd, &temp); > + if (ret && data->soc != SOC_ARCH_EXYNOS5433) { /* FIXME */ > dev_err(&pdev->dev, > "No CRITICAL trip point defined in device tree!\n"); > goto out; Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland