Commit c4b43d83 authored by Yang Ruibin's avatar Yang Ruibin Committed by Jonathan Cameron

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: default avatarYang Ruibin <11162571@vivo.com>
Link: https://patch.msgid.link/20240821083911.3411-1-11162571@vivo.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent d35099d3
......@@ -219,7 +219,7 @@ void iio_backend_debugfs_add(struct iio_backend *back,
snprintf(name, sizeof(name), "backend%d", back->idx);
back_d = debugfs_create_dir(name, d);
if (!back_d)
if (IS_ERR(back_d))
return;
if (back->ops->debugfs_reg_access)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment