Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5053581rwb; Mon, 8 Aug 2022 11:16:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR6uuNX7wUMCo56A55tBc8Kao/+AII9Zo/zA4q5YzyX05XPi9JMcNUvWLkik4b+GBNQ1JuF0 X-Received: by 2002:a17:907:72cb:b0:72b:820a:f09b with SMTP id du11-20020a17090772cb00b0072b820af09bmr14315097ejc.335.1659982616251; Mon, 08 Aug 2022 11:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659982616; cv=none; d=google.com; s=arc-20160816; b=Fzts0cCPVOQzsZCa8zfOR9jhjImCBEBjCssUURP6PyBLGg0s6Pf14dhWeucaTYNLZo TUKg0RtZU8LY9+AYp4yqcDlmvRIOrc3hjGx1Qjb9OnmAzp+TYnFGsQJl1i2WOuzaBX4J 8zGounAQwWvI28+Nh0tZ4lO/wR5Wf1B+jPOJfJ+6cLzyXuoQ+P2RfLio2H+ZzE/LqYtP M4XExaRF3amqpudebrgOvYeUaGtGiUqPiXcZfItz35ZN0pU5Tr4HXpQOUfHGdfRFHpXt +SoeKmrarthEh2p+O3+mjXj3yfKcUD6UGT59hvRJp1BBOZXrzLxToepFGDKTLWdHS9/e lutg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=E7W+A8RBq7Usp9JU9F1Ru53gxwOjNDrCjAkC1uG7hB8=; b=cOFphAdEHl8J59y0f2uv17iBctLKa0xzeBEcBkYTrTp6Iq1xzkgp4NFfoos4YIrcV1 VfJXVdVpAy2CAeqyxOyxl0xWc5nLbWKbjtI7ICN+6MTKaQ4nKNTLyBwua6QoE3ZCjMLa Ohyrwde/joVRIVG1nehToj1LnXINpbwYj3oHxN/c76BCDvwZml6kl1PNnmsMjW+CY/tu 8u9lQHsok2qkwmDz707jWW9QlkCTaXSlrLljZwG8ckWPdbmEvGjfBuUm6F5oOR88AFGu 2uiDOH0r+ZEDPU7g1PYvO3LN60D7iqtNugDrl17Qj+jLToPCkyNv+qA+A5QqANfVCJBs 6LHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K1ljnjez; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he15-20020a1709073d8f00b00730824744dasi217293ejc.507.2022.08.08.11.16.30; Mon, 08 Aug 2022 11:16:56 -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=@linaro.org header.s=google header.b=K1ljnjez; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243717AbiHHSJg (ORCPT + 99 others); Mon, 8 Aug 2022 14:09:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235853AbiHHSJf (ORCPT ); Mon, 8 Aug 2022 14:09:35 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EECD46154 for ; Mon, 8 Aug 2022 11:09:33 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id p10so11749611wru.8 for ; Mon, 08 Aug 2022 11:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=E7W+A8RBq7Usp9JU9F1Ru53gxwOjNDrCjAkC1uG7hB8=; b=K1ljnjeze7jNd1Zry0QkH2fhPDlX4fViK9SEP0ye2TfZ0hIaFCk11ir0aKzI96yU6/ kehdi1SBDLMrlVbw97VVun0eqb8sSxT4mErssG/JBp9XCPJ3I80VxDHazp3MP9AFUGSa eVUeMb9pY7FzZFyJFuZPtkQUH8Q7PzhSXyjqOOl6DKZxk7u8mtP+TcmxRMGYxWVJ0Zi3 H4WWA1qwaDtUxeN/WpD6qWRREb+f7aYYio3NZ42avgXpkN2tDLujhbCNpLNsPxglScLf qoz5ntjRGBftLN+DUJr1Yw7bMl0gugyr4eydRAcRnTLU9PbiOUdePA1VwEOc0Kt5VWY3 DjCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=E7W+A8RBq7Usp9JU9F1Ru53gxwOjNDrCjAkC1uG7hB8=; b=gv0rnT1xC02jacWtLIJDuX9693MIemFyAUY8BCuykc0GMb9uhQBH7VNFhTROOHacEC q4OZb8t51ldaCkUziZps1FaekPTcN0NuXVhrNtjL5R5FPVgtfsDI7YZ0i6lGUM/n4xt9 DAE8bfAqw+b/q/L4ebk/r6FUHjMoaLEJY71bzFwhOd8rAyj0Km13MvGZgI9C8yPY3m3w XOKMP6Gcw/D+8k6R6Gi8FS72ul3PQZBatkrM0zYKqjDwNVj8b1rR+ancon7uL4HQfLqJ EnkW18do5vu6LtaqeV6dVQEoI8s38+Ykr4CVfk+jBZo59Foq3rRiMGfOrZ47ujClcuFu 53TQ== X-Gm-Message-State: ACgBeo1qfa8zX4mc9qwc8hH5jAwI9ub3LIqxq3v/qTOZONRtTWXUvnQF 9fQB4dtF3GUUKAzCA7HPcRH1IA== X-Received: by 2002:a05:6000:178a:b0:221:1b91:c8fa with SMTP id e10-20020a056000178a00b002211b91c8famr10941704wrg.245.1659982172473; Mon, 08 Aug 2022 11:09:32 -0700 (PDT) Received: from mai.. (146725694.box.freepro.com. [130.180.211.218]) by smtp.gmail.com with ESMTPSA id c5-20020a5d4f05000000b002205a5de337sm11937309wru.102.2022.08.08.11.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Aug 2022 11:09:31 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: michael@walle.cc, dan.carpenter@oracle.com, linux@roeck-us.net, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Zhang Rui Subject: [PATCH 1/4] thermal/of: Fix error code in of_thermal_zone_find() Date: Mon, 8 Aug 2022 20:09:12 +0200 Message-Id: <20220808180915.446053-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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 From: Dan Carpenter Currently, if we cannot find the correct thermal zone then this error path returns NULL and it would lead to an Oops in the caller. Return ERR_PTR(-EINVAL) instead. Fixes: 3bd52ac87347 ("thermal/of: Rework the thermal device tree initialization") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YvDzovkMCQecPDjz@kili Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_of.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index c2bb5954b21e..368eb58e97cf 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -368,6 +368,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int } } } + tz = ERR_PTR(-EINVAL); out: of_node_put(np); return tz; -- 2.34.1