From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 8 Mar 2016 15:05:46 +0300 From: Dan Carpenter To: Alexander Viro , Shaohua Li Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] block-dev: checking for NULL instead of IS_ERR() Message-ID: <20160308120546.GB28684@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: 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 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; }