[patch] block-dev: checking for NULL instead of IS_ERR()
From: Dan Carpenter
Date: Tue Mar 08 2016 - 07:06:17 EST
This should be an IS_ERR() check. mount_pseudo() returns error pointers
and this function should return the error pointer to its caller as well.
Fixes: 3684aa7099e0 ('block-dev: enable writeback cgroup support')
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 3172c4e..2de969e 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -577,7 +577,7 @@ static struct dentry *bd_mount(struct file_system_type *fs_type,
{
struct dentry *dent;
dent = mount_pseudo(fs_type, "bdev:", &bdev_sops, NULL, BDEVFS_MAGIC);
- if (dent)
+ if (!IS_ERR(dent))
dent->d_sb->s_iflags |= SB_I_CGROUPWB;
return dent;
}