Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 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>

authored by

Haotian Zhang and committed by
Jassi Brar
3acf1028 060e4e83

+1 -1
+1 -1
drivers/mailbox/mailbox-test.c
··· 268 268 return 0; 269 269 270 270 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)) { 272 272 dev_err(&pdev->dev, "Failed to create Mailbox debugfs\n"); 273 273 return -EINVAL; 274 274 }