From patchwork Fri Mar 19 20:24:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 404824 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1681927jai; Fri, 19 Mar 2021 13:25:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHnGfH84cD57bs6BNFjMx9IXNtwJQRYbvx2a5/m08XcZ8qgBq1IvB6XD2yC88uX1OZTCTa X-Received: by 2002:a17:906:4cd6:: with SMTP id q22mr6383713ejt.469.1616185524422; Fri, 19 Mar 2021 13:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616185524; cv=none; d=google.com; s=arc-20160816; b=ZWgn/O511F5/6huaPPVZfJImSpZJNHQuAIyYsBHMCvOmzkXxkjJc6imb3AH3nLv0b1 ddEJ0hUfIS6AUpaRhJiplPNiHZ9Io6L44uikhnbUtKGVy3SvNlJ2owEd88seSa5dOLDW 66ZJbQkPaSE+RkiukFmm2uQKwrGBKIc+w9PO3xEE3fyeJWhjVtUlVwXnGrAtqsJvVLPE GPZtrhq2A0E3swqJHf9kHzR4ZKB2aM9/Dt0uuNZNR046dZNMF//6f+s0KWgbJJtcXXPB B1kr5Qx65jf1qTIt3aI01PLGeMY6GPZd35q9jYwW+4TBBPeyMI2qWtyNtERX7h/cA3F0 Spiw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=To100haQPKOBjLlAqeL1HTpqN/JRH0WmiZY+PGrzAJo=; b=s5ocOFrxKC9XIKaixYt1gNLSWyCX4hK5clsPj3FEbQn9V/hpDidII4x6dglV1tXmDF 6Ww0eXFdtDHUx+PaZxg6PSQH3Q5SUb6+f7Mr3PmUbvWjp51JojyLkQB8uktqcfNLyNAF LuZb7j0rCXP1B03LQJHJJJxqtSI6RZRAKHx1KwBCif7ztFLKKwbBDg/7oeF5XHpUv5WN VLouCx+BMY9pNCCpEztQ3vfoGZ5mrpQLBQb8TPZ8ynkbpklYKUGH2v96bb9YDVwBy3Y7 G+DT1Pu5idez9s3h6UOsKaxSnFvgKfWA/lsiZNt5fROElOmuXKVdHDV2eATJ388///LF c5cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yc+n7UFN; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si4549332edd.298.2021.03.19.13.25.24; Fri, 19 Mar 2021 13:25:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-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=@linaro.org header.s=google header.b=yc+n7UFN; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S229990AbhCSUYt (ORCPT + 7 others); Fri, 19 Mar 2021 16:24:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230394AbhCSUYk (ORCPT ); Fri, 19 Mar 2021 16:24:40 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C133C06175F for ; Fri, 19 Mar 2021 13:24:40 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id k8so10338188wrc.3 for ; Fri, 19 Mar 2021 13:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=To100haQPKOBjLlAqeL1HTpqN/JRH0WmiZY+PGrzAJo=; b=yc+n7UFNfb9dxeA2Qs7dVY+hwA4gBRhOjbL7I+oh0myXqdqg8bt2XRwiG+ZlOZ++Lb fPKZ5q/srgACP5q5a+EToVqcFt6sZJrubgCPEVmUvO7LKiEAUcqmunaouDvdvZX4x9uL 6KonOLsVOZntozK9QDpcpbv7/ij5wo+W2G73pxviWQohfnfxtXQeyIRJ/P1eGikkjDG+ VSe2QguDwT4vvHNG9lIlOzYNVQDY3ibzenaCDHQI1pKSxDba6g2uvbxXAOFD+xOmnCYX T0T2FJZwIen0BYPlYAh0Iy0P1rIsQaWyI30b8Uo/OzbMfog0X6bfywZuTxX1MGBYCDvl BAvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=To100haQPKOBjLlAqeL1HTpqN/JRH0WmiZY+PGrzAJo=; b=FuDrX37MSTkjAvN2YV9nsDLisrmByUiEHgEwz7OIFqH40sO6o+xq6ED+f18n6nqOqr 4z9l7s1m/zND90hsx6JsakFGjSTITyleU8iiUVC8g6GVWZstIqiL4x5MRDh/O8zNzVBM Kjm4rj5YwObaqFsL9mfYpkk4plEitc30sXM+N1E7hIanx4KO3AB9CvVF9s846L0wD4we KEY8QHA/ILL00J2le06WygELVaK/qzBOiSa+Us2F0OLsH1ahR2HrxH/mqVUccSsJmZcA Ck6ZEz+2YOZSIn6Gtk3Qo3FwPEbJUae10aQ/Mk5BBjnRYwzJolYyVCa6G1ix/mGz1eQG Eudw== X-Gm-Message-State: AOAM5317j0HY981Ad3XJOTw3SZwmjzfFpj42cxmoK5g/MIrBEv6CUd7L IGhkr0vQ6FePmXXq3brOMPZXpw== X-Received: by 2002:adf:e805:: with SMTP id o5mr6527004wrm.196.1616185479092; Fri, 19 Mar 2021 13:24:39 -0700 (PDT) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:ddd7:1eb:a66:7a85]) by smtp.gmail.com with ESMTPSA id y10sm9796122wrl.19.2021.03.19.13.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Mar 2021 13:24:38 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org Cc: kernel test robot , Dan Carpenter , Zhang Rui , Amit Kucheria , linux-pm@vger.kernel.org (open list:THERMAL), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] thermal/drivers/devfreq_cooling: Fix wrong return on error path Date: Fri, 19 Mar 2021 21:24:23 +0100 Message-Id: <20210319202424.890968-1-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210317143126.GC2087@kadam> References: <20210317143126.GC2087@kadam> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The following error is reported by kbuild: smatch warnings: drivers/thermal/devfreq_cooling.c:433 of_devfreq_cooling_register_power() warn: passing zero to 'ERR_PTR' Fix the error code by the setting the 'err' variable instead of 'cdev'. Fixes: f8d354e821b2 ("thermal/drivers/devfreq_cooling: Use device name instead of auto-numbering") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Daniel Lezcano --- drivers/thermal/devfreq_cooling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c index fb250ac16f50..3a788ac4f525 100644 --- a/drivers/thermal/devfreq_cooling.c +++ b/drivers/thermal/devfreq_cooling.c @@ -402,7 +402,7 @@ of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df, if (err < 0) goto free_table; - cdev = ERR_PTR(-ENOMEM); + err = -ENOMEM; name = kasprintf(GFP_KERNEL, "devfreq-%s", dev_name(dev)); if (!name) goto remove_qos_req;