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 87FD2BA49 for ; Tue, 7 Mar 2023 18:50:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E87A6C433EF; Tue, 7 Mar 2023 18:50:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678215051; bh=mtwwF1p3cwQQwwydNl4TwINE95vZ62i3LE2XQ20Zj+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vkxyD4PLRXyRF5VY/N8GhsrbSbb3RY3L+0Yy7TMC/EEN0AtXFT2H/mVFAiFkUgIUF hdGITounggohmgFPEs9D2Omq6uVt9tHyLrF4ZdiJ8BqLNvxTWD+YiGFGEzv8H24kRH XnuQjb7XGfWY3ga8RT13swNJS2DO8jVijkAJu2T8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Qi Zheng , Viresh Kumar , Sasha Levin Subject: [PATCH 5.15 136/567] OPP: fix error checking in opp_migrate_dentry() Date: Tue, 7 Mar 2023 17:57:52 +0100 Message-Id: <20230307165911.786038602@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307165905.838066027@linuxfoundation.org> References: <20230307165905.838066027@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: Qi Zheng [ Upstream commit eca4c0eea53432ec4b711b2a8ad282cbad231b4f ] Since commit ff9fb72bc077 ("debugfs: return error values, not NULL") changed return value of debugfs_rename() in error cases from %NULL to %ERR_PTR(-ERROR), we should also check error values instead of NULL. Fixes: ff9fb72bc077 ("debugfs: return error values, not NULL") Signed-off-by: Qi Zheng Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/opp/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/opp/debugfs.c b/drivers/opp/debugfs.c index b5f2f9f393926..9eb71f47487b2 100644 --- a/drivers/opp/debugfs.c +++ b/drivers/opp/debugfs.c @@ -209,7 +209,7 @@ static void opp_migrate_dentry(struct opp_device *opp_dev, dentry = debugfs_rename(rootdir, opp_dev->dentry, rootdir, opp_table->dentry_name); - if (!dentry) { + if (IS_ERR(dentry)) { dev_err(dev, "%s: Failed to rename link from: %s to %s\n", __func__, dev_name(opp_dev->dev), dev_name(dev)); return; -- 2.39.2