summaryrefslogtreecommitdiff
path: root/drivers/mailbox
diff options
context:
space:
mode:
authorHaotian Zhang <vulab@iscas.ac.cn>2025-11-20 10:40:39 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-07 06:27:33 +0900
commit78db090440c566bad3e4cded514a11ae2f802014 (patch)
treeec5d77e22658fe0537a1e5e8824937d6a3b75584 /drivers/mailbox
parente80aaf3aff150bbd164d7a21806fcf77be97cbdf (diff)
downloadlinux-78db090440c566bad3e4cded514a11ae2f802014.tar.gz
linux-78db090440c566bad3e4cded514a11ae2f802014.tar.bz2
linux-78db090440c566bad3e4cded514a11ae2f802014.zip
mailbox: mailbox-test: Fix debugfs_create_dir error checking
[ Upstream commit 3acf1028f5003731977f750a7070f3321a9cb740 ] The debugfs_create_dir() function returns ERR_PTR() on error, not NULL. The current null-check fails to catch errors. Use IS_ERR() to correctly check for errors. Fixes: 8ea4484d0c2b ("mailbox: Add generic mechanism for testing Mailbox Controllers") Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/mailbox')
-rw-r--r--drivers/mailbox/mailbox-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c
index c9dd8c42c0cd..3a28ab5c42e5 100644
--- a/drivers/mailbox/mailbox-test.c
+++ b/drivers/mailbox/mailbox-test.c
@@ -268,7 +268,7 @@ static int mbox_test_add_debugfs(struct platform_device *pdev,
return 0;
tdev->root_debugfs_dir = debugfs_create_dir(dev_name(&pdev->dev), NULL);
- if (!tdev->root_debugfs_dir) {
+ if (IS_ERR(tdev->root_debugfs_dir)) {
dev_err(&pdev->dev, "Failed to create Mailbox debugfs\n");
return -EINVAL;
}