From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1018C1ED3A for ; Tue, 25 Jul 2023 11:13:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CD6BC433C7; Tue, 25 Jul 2023 11:13:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690283598; bh=XFLSk5w70TFVfsmRU08KEh/NP1GO091DIxUj4zqAwrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wq0TZy8M1/USOWQZwWr0tCjGrdXO6YXBzZS/hK7xKTnGj0fNpzHcvQa2MFjOCAnjr 4FrALtTaC/S223WBqLU378YkdN1wjWxQHSyO9tIk+lyw5qIg5xlfOJSSNA59gwgHZQ YdXFyTSFnBexE35DXSDY3Ki5wmhOtS9IgN1SoPXc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Geert Uytterhoeven , Mark Brown , Sasha Levin Subject: [PATCH 5.10 054/509] regulator: core: Fix more error checking for debugfs_create_dir() Date: Tue, 25 Jul 2023 12:39:53 +0200 Message-ID: <20230725104556.154088562@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230725104553.588743331@linuxfoundation.org> References: <20230725104553.588743331@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Geert Uytterhoeven [ Upstream commit 2715bb11cfff964aa33946847f9527cfbd4874f5 ] 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 Link: https://lore.kernel.org/r/ee980a108b5854dd8ce3630f8f673e784e057d17.1685013051.git.geert+renesas@glider.be Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 f5ab74683b58a..e4ff64d28c778 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1751,7 +1751,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.39.2