Commit 3acf1028 authored by Haotian Zhang's avatar Haotian Zhang Committed by Jassi Brar
Browse files

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: 8ea4484d ("mailbox: Add generic mechanism for testing Mailbox Controllers")
Signed-off-by: default avatarHaotian Zhang <vulab@iscas.ac.cn>
Signed-off-by: default avatarJassi Brar <jassisinghbrar@gmail.com>
parent 060e4e83
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}