Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5692503rwd; Wed, 24 May 2023 05:40:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4b1lW79xOUtqhu3BNVST4SMt1MxwMigLsp+NHf4N4wY0hX+J5hqwxbZAWBJ/XkJs4buBv/ X-Received: by 2002:a05:6a20:7d81:b0:10c:8e4e:f303 with SMTP id v1-20020a056a207d8100b0010c8e4ef303mr5962099pzj.44.1684932021469; Wed, 24 May 2023 05:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684932021; cv=none; d=google.com; s=arc-20160816; b=hy/U4vJ0uQ4eDH5F/SMxZSzcux2XnFze+2BtOwGf4YZ5zTMKpf45VMPi0zNJ5SbP5h nUQFRg/IPwkjkPMmxMBby0bRw4RE2W/diX8OGkffGymF+sbid7fhhV0/IUFuyTqMZSvS aVZ/hNolFB+Xfvy6TWtuEHCANiFuew9uktQW0SnK4jicq4EdEKfqVhtvUSJvpDzRwQIR HC13A6WBXg/pZD6czhTLqZdZ9TWxwtS/wCEM8O13o5iy41WFzOgc3wAGeMUh1jdtSQqN b0699ttUXI4sBNcQiY+G6+WSrVcpXRbgy2e9DhG6/u52pa1sN8m1RxAni0MA65vSoPyj Cn8w== 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; bh=PCizjfO687RH0Ch+ggLJGGH34Zydf++kdVhgZ0USbvg=; b=RvtVTJ3ko4Z1mbfw8YCBZM4bshYcitXAIObFMQSPdqNVxlV/tBcwwxqJ96SopTnm7Q tZv/seooq288iFPiKMmqynqjNLJoD+IIDLL0JoIQSr1RErxF573vUIevqdsgFQ8Dxt/X jzdObI6h4x2KIkGqdvrJqdrDBl9IR9JTvuBjI3c4OUDG3gG0h8khhRjzkc4ZNCvSVCLp r8F8G7jxYNeu225RHbp0rfkgtmL+ZgbxuSy4bWGcmrqX9falsCGxW/rR6nN3y3eIlthL RF58BLQu6iFK2eq16dNkb0jQhIghyqjRjrC1TeFoF+ShpDPGd9UMj9NjU9my6HZ6fo4+ K27Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u185-20020a6385c2000000b0053476becd25si8137213pgd.285.2023.05.24.05.40.05; Wed, 24 May 2023 05:40:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233003AbjEXMWe (ORCPT + 99 others); Wed, 24 May 2023 08:22:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231422AbjEXMW0 (ORCPT ); Wed, 24 May 2023 08:22:26 -0400 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6213F9E for ; Wed, 24 May 2023 05:22:22 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed30:59b9:3473:f0ae:e2b7]) by laurent.telenet-ops.be with bizsmtp id 0cNL2A00C5NiV2701cNLTe; Wed, 24 May 2023 14:22:20 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1q1nVF-002xw9-Aj; Wed, 24 May 2023 14:22:20 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1q1nVU-00DPCA-C7; Wed, 24 May 2023 14:22:20 +0200 From: Geert Uytterhoeven To: Liam Girdwood , Mark Brown , Osama Muhammad Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 1/2] regulator: core: Fix more error checking for debugfs_create_dir() Date: Wed, 24 May 2023 14:22:17 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, 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 In case of failure, debugfs_create_dir() does not return NULL, but an error pointer. Most incorrect error checks were fixed, but the one in create_regulator() was forgotten. Fix the remaining error check. Fixes: 2bf1c45be3b8f3a3 ("regulator: Fix error checking for debugfs_create_dir") Signed-off-by: Geert Uytterhoeven --- v2: - Split off from "regulator: core: Streamline debugfs operations". --- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 698ab7f5004bf6b7..ad8baf65f63e369b 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1911,7 +1911,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev, if (err != -EEXIST) regulator->debugfs = debugfs_create_dir(supply_name, rdev->debugfs); - if (!regulator->debugfs) { + if (IS_ERR(regulator->debugfs)) rdev_dbg(rdev, "Failed to create debugfs directory\n"); } else { debugfs_create_u32("uA_load", 0444, regulator->debugfs, -- 2.34.1