mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 03:48:59 +00:00
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 <11162571@vivo.com> Link: https://patch.msgid.link/20240821083911.3411-1-11162571@vivo.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
d35099d3c6
commit
c4b43d8336
@ -219,7 +219,7 @@ void iio_backend_debugfs_add(struct iio_backend *back,
|
|||||||
snprintf(name, sizeof(name), "backend%d", back->idx);
|
snprintf(name, sizeof(name), "backend%d", back->idx);
|
||||||
|
|
||||||
back_d = debugfs_create_dir(name, d);
|
back_d = debugfs_create_dir(name, d);
|
||||||
if (!back_d)
|
if (IS_ERR(back_d))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (back->ops->debugfs_reg_access)
|
if (back->ops->debugfs_reg_access)
|
||||||
|
Loading…
Reference in New Issue
Block a user