block-dev: checking for NULL instead of IS_ERR()
Subsystems (2)
PATCH 1/1 block-dev: checking for NULL instead of IS_ERR()
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 <[email protected]>
fs/block_dev.c +1 -1
@@ -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; }
Quoted 5 lines · Dan Carpenter
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 <[email protected]>
Looks fine. Would be much nicer to simply pass possible flags as an argument to mount_pseudo to avoid this whole dance..
Reviewed-by Christoph Hellwig <[email protected]>