Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp808001rwd; Thu, 25 May 2023 04:23:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6mp/i81I8KM7wIbE0Zdp+P3ZoHuTYEn+XrDyx0KrtHegbn0nsvE4ujzAcCcKrsLIbI6/Zm X-Received: by 2002:a17:90a:3d0a:b0:254:ce9e:53 with SMTP id h10-20020a17090a3d0a00b00254ce9e0053mr1482238pjc.23.1685013821613; Thu, 25 May 2023 04:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685013821; cv=none; d=google.com; s=arc-20160816; b=wsyu/dvoyqVKqZ4ipnjU4bCMXVmh/O2OVjguof2Q9VmyKdGikEPgQb1GAR+x8Sfe15 qvaNoxbzNanAxyPpF5qDIgK0MuXqnt0Sw77LCSOWDTgFb2TtvDxkxwIUck+3Vdliz0zR itIwVNFLVDXxBpbDMO97nHdriOXz5cu5sUusLIorGkmn1ePMxYEuGai1PV37c5YcySsL ybdqrrmoU4iZNAhxNddAQlAjY3+9XB0KDEt/W20gw4qUu/GkGQUNFSpN83uRzRMNFz8v cWtPNreLKip6im0Du0fvZiEg8cGYJ3imsQO5yKjR2KVtPQZLYc5scjqTiEuPLsFVa36r ZBJg== 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=zFxv892FaRfdbSdfh3qj09gKSdV31MI7qfYd1BZvuz0=; b=jcQzt2mkpL9bbuUOo50rrcZS4itb1G/5iOEOfWY6QirkQbzujI/fkDZfBnKNk+bCo2 nJzDTPcsukovqj1bj3XFCDbr3EHP/swQ/l9Ne7s0yeo/vgsQgQuGYXk9NNNdE2zi9Tpn z0spxcxyvsvrBXEnnLuhEOoP6jjTYKG86GmnW64YCp6PFuMksbOCr2n9J9fTodvmG4bC Bf7+ilk3qQsZn7rknkeBtq2hydRfVe0AgM90aRmGleLdBYerWXxDvaCvXx7xeUDU/SDt ARdenlMnObZcj60bPptvQMs6E5QRv/bZo950WVS2aejG1eDLplh5KemCu9fyO6oLR1qH Ptvw== 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 j191-20020a6380c8000000b005250c24fa2esi897610pgd.428.2023.05.25.04.23.27; Thu, 25 May 2023 04:23:41 -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 S240638AbjEYLOG (ORCPT + 99 others); Thu, 25 May 2023 07:14:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233816AbjEYLOE (ORCPT ); Thu, 25 May 2023 07:14:04 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5366DE7 for ; Thu, 25 May 2023 04:14:03 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed30:59b9:3473:f0ae:e2b7]) by baptiste.telenet-ops.be with bizsmtp id 0zE02A0055NiV2701zE0g8; Thu, 25 May 2023 13:14:00 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1q28ue-00349i-N8; Thu, 25 May 2023 13:14:00 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1q28uu-00DnlU-EX; Thu, 25 May 2023 13:14:00 +0200 From: Geert Uytterhoeven To: Liam Girdwood , Mark Brown , Osama Muhammad Cc: linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 1/2] regulator: core: Fix more error checking for debugfs_create_dir() Date: Thu, 25 May 2023 13:13:58 +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 --- v3: - Re-add accidentally dropped opening curly brace, 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..c1bc4729301d5fed 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