Skip to content

Commit 3acf102

Browse files
ISCAS-VulabJassi Brar
authored andcommitted
mailbox: mailbox-test: Fix debugfs_create_dir error checking
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: 8ea4484 ("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>
1 parent 060e4e8 commit 3acf102

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mailbox/mailbox-test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static int mbox_test_add_debugfs(struct platform_device *pdev,
268268
return 0;
269269

270270
tdev->root_debugfs_dir = debugfs_create_dir(dev_name(&pdev->dev), NULL);
271-
if (!tdev->root_debugfs_dir) {
271+
if (IS_ERR(tdev->root_debugfs_dir)) {
272272
dev_err(&pdev->dev, "Failed to create Mailbox debugfs\n");
273273
return -EINVAL;
274274
}

0 commit comments

Comments
 (0)