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 03B83BA32 for ; Tue, 7 Mar 2023 17:19:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60F99C4339B; Tue, 7 Mar 2023 17:19:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678209588; bh=pCjhOI+24E8QsJcLEAAD8riVrPI6HVWUFWD9oJLvHbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=imnX6KL87NrMNMveLhCBmUq94BH8nO+kF2q7ITwNMNR3x9CpxrMNq+z3Uv3FBy77o ehpT6ul4DP8sExXrMtqX3NK/0bjjiG3HZu9tiQEe7kEtU9LV7RCk5X33jm7KWRmFtu CbyI0LufQxzK85bv8JGV0EjNz3P+0Q3z7uDRKDfM= 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 6.2 0268/1001] OPP: fix error checking in opp_migrate_dentry() Date: Tue, 7 Mar 2023 17:50:40 +0100 Message-Id: <20230307170033.351486738@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170022.094103862@linuxfoundation.org> References: <20230307170022.094103862@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 96a30a032c5f9..2c7fb683441ef 100644 --- a/drivers/opp/debugfs.c +++ b/drivers/opp/debugfs.c @@ -235,7 +235,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