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.

nbd: Fix debugfs_create_dir error checking

The debugfs_create_dir function returns ERR_PTR in case of error, and the
only correct way to check if an error occurred is 'IS_ERR' inline function.
This patch will replace the null-comparison with IS_ERR.

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230512130533.98709-1-ivan.orlov0322@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ivan Orlov and committed by
Jens Axboe
4913cfcf ac9a7868

+2 -2
+2 -2
drivers/block/nbd.c
··· 1666 1666 return -EIO; 1667 1667 1668 1668 dir = debugfs_create_dir(nbd_name(nbd), nbd_dbg_dir); 1669 - if (!dir) { 1669 + if (IS_ERR(dir)) { 1670 1670 dev_err(nbd_to_dev(nbd), "Failed to create debugfs dir for '%s'\n", 1671 1671 nbd_name(nbd)); 1672 1672 return -EIO; ··· 1692 1692 struct dentry *dbg_dir; 1693 1693 1694 1694 dbg_dir = debugfs_create_dir("nbd", NULL); 1695 - if (!dbg_dir) 1695 + if (IS_ERR(dbg_dir)) 1696 1696 return -EIO; 1697 1697 1698 1698 nbd_dbg_dir = dbg_dir;