Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2382987rwd; Wed, 17 May 2023 09:12:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4+WPi3PP2uF+FNX7gJsLR4ZQtR+cSUoprNOLbWcxyefA2fbBlvncHB/mBb5LiRBjGl18Za X-Received: by 2002:a17:902:a604:b0:1ac:b363:83b3 with SMTP id u4-20020a170902a60400b001acb36383b3mr25002562plq.41.1684339934430; Wed, 17 May 2023 09:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684339934; cv=none; d=google.com; s=arc-20160816; b=ag55iBtKw9MTsUwv6ttPLdGEiTQiRXaPtLrH0g0aMSq89wO9NMWAp0F203nwRumzoB OxkkQSO0BOzZKF+cpCY9e32Egplvon9Jn2KbmMglTbDe4EOcCv+TMpbnPYR7YhVyB9vg ejBk4Vgvz5zkxE3LN1iiagfQgZmLIWXGJlCUiHtpTpuf+gGyRbIi5+QyvU/J+0NhoUcW ntU0YZ1dksbhIimRKMoV2xYgm15rWDpbkRvCUm1kacfUmDzNCOt9KdvBtn5XZVWapQhX 2QX8cjm1IC/1OTvJnv6vbtfF41hy7v6dhGQgs8orTLnkE6WUncWdRGxUpq3kXbVOL18K Ls0A== 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=JbDnB2PXIbg1nrLsvecGt1DuT+K73v6dCg1HZevcZvc=; b=WugLA+4FcVOKEdKuvY8nhmyYNg3rVOEasJIQaj1tnjrozdVK3GvHscwInMC6i37kPH 16XNo/YSyjqqZpQHxEoxEp53XDYTQhtdtA28K6ZKlO16HQYRxgKhqzS+0kp1bpQzZ7qa M6sCyXSgRwa5255sbQe7ONQaB+IlgKfjRU1IrV0WIYg34Rh/oG4Abvu42F7+xLeFISBh jVnYAayRcn/bzPMQj/rI2Ed43C7VjX/YQvdTdLE1NdJMofpwQRmkjbeTyplrqBVT6yEp 7na1XVW7otyxemuhPmaEjhaaB8eQ10BLfjko6FLSIiYISDwNyh50pyBWphydfegeLcmb ARJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="R+JAY/0n"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020a17090264c900b001ae515f032esi1808148pli.481.2023.05.17.09.12.01; Wed, 17 May 2023 09:12:14 -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=@gmail.com header.s=20221208 header.b="R+JAY/0n"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230282AbjEQQF1 (ORCPT + 99 others); Wed, 17 May 2023 12:05:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbjEQQF0 (ORCPT ); Wed, 17 May 2023 12:05:26 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97109110; Wed, 17 May 2023 09:05:25 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-52c30fbccd4so816815a12.0; Wed, 17 May 2023 09:05:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684339525; x=1686931525; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=JbDnB2PXIbg1nrLsvecGt1DuT+K73v6dCg1HZevcZvc=; b=R+JAY/0n8zLGV8wFotOEzEJpiiGuPQJiOm3W4d16A9wrPM1VEk7cqZDc7jDh7VwHLe bMfHTeB3HFe7LBnZYLy7u9GRO9cQp9E7/Jg/2Vbjq5L9P7NGAxrkq/yNS/oDK1S3rb0W t9YJJ7xXTylFuZbhTJcmFSWCJJLRU12eopskn9Dy224gmIMOaP8JSFVepuxZfT10XCIw 0MjvLgzetNIOv0z0ngngo7kh8a3lsXnIfZ93k/eTETASKJZlEg2EBMgQDdx0Dmnrj3tY nqyGZIaDur0HDgK+/Gy3hwzO3fth3LXQKpSiqX2QJsssWza9bQS3nZntIgG9rnIsZ30m HADg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684339525; x=1686931525; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JbDnB2PXIbg1nrLsvecGt1DuT+K73v6dCg1HZevcZvc=; b=N/43dhOqs62g2dLEahPWPiMST66f4C8siv5W+I5AwMX5gBHu67KYSA8kmk4DFFvxe8 RuoTmt/fNT+PnVS9FxTcJdlfW703mxCrvlxNkv2ikWUTej74MJghpTtFr3UE46CeC3Pk rq3cle3jufoEasf67AlqMoir51tXzZnaGSllQyqTjj8RqRez37eRa9QJ3ENa9ka36IOH 3rjCHLDJ7i78LuA6ETvwExmTSTlAxgV9Ga9nzZdcvomNph3F/nShGwPCEIe9AJDuBzfI B0F9ldHl62q+wi1tlQQb28pUMC+o15yUCezzMchtSvHjUf7OFqkmWOmA6SRL9XxRbLIy bzbw== X-Gm-Message-State: AC+VfDzCzWMt/e1j4KCHHUoUZaK3dC5ccXbbGQVIyl/NYz/HcHYkv7dA 0urb4yrXU7WCVtZBboXVPBQ= X-Received: by 2002:a17:90b:3645:b0:250:d137:e2ae with SMTP id nh5-20020a17090b364500b00250d137e2aemr168165pjb.23.1684339524459; Wed, 17 May 2023 09:05:24 -0700 (PDT) Received: from Osmten.. ([103.84.150.101]) by smtp.gmail.com with ESMTPSA id o4-20020a17090ad20400b00250c1392ed3sm1761949pju.55.2023.05.17.09.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 09:05:23 -0700 (PDT) From: Osama Muhammad To: rafael@kernel.org, daniel.lezcano@linaro.org, amitk@kernel.org, rui.zhang@intel.com, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, bchihi@baylibre.com, wenst@chromium.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Osama Muhammad Subject: [PATCH] lvts_thermal.c: Fix error checking for debugfs_create_dir Date: Wed, 17 May 2023 21:03:26 +0500 Message-Id: <20230517160326.10732-1-osmtendev@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 This patch fixes the error checking in lvts_thermal.c in debugfs_create_dir. The correct way to check if an error occurred is 'IS_ERR' inline function. Signed-off-by: Osama Muhammad --- drivers/thermal/mediatek/lvts_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index d0a3f95b7884..61386be78fa0 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -188,7 +188,7 @@ static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td) int i; lvts_td->dom_dentry = debugfs_create_dir(dev_name(dev), NULL); - if (!lvts_td->dom_dentry) + if (IS_ERR(lvts_td->dom_dentry)) return 0; for (i = 0; i < lvts_td->num_lvts_ctrl; i++) { @@ -197,7 +197,7 @@ static int lvts_debugfs_init(struct device *dev, struct lvts_domain *lvts_td) sprintf(name, "controller%d", i); dentry = debugfs_create_dir(name, lvts_td->dom_dentry); - if (!dentry) + if (IS_ERR(dentry)) continue; regset = devm_kzalloc(dev, sizeof(*regset), GFP_KERNEL); -- 2.34.1