Skip to content

Commit c4b43d8

Browse files
Yang Ruibinjic23
authored andcommitted
drivers:iio:Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
The debugfs_create_dir() function returns error pointers. It never returns NULL. So use IS_ERR() to check it. Signed-off-by: Yang Ruibin <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent d35099d commit c4b43d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/industrialio-backend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void iio_backend_debugfs_add(struct iio_backend *back,
219219
snprintf(name, sizeof(name), "backend%d", back->idx);
220220

221221
back_d = debugfs_create_dir(name, d);
222-
if (!back_d)
222+
if (IS_ERR(back_d))
223223
return;
224224

225225
if (back->ops->debugfs_reg_access)

0 commit comments

Comments
 (0)