linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>, Shaohua Li <shli@fb.com>
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()
Date: Tue, 8 Mar 2016 15:05:46 +0300	[thread overview]
Message-ID: <20160308120546.GB28684@mwanda> (raw)

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@oracle.com>

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;
 }

             reply	other threads:[~2016-03-08 12:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 12:05 Dan Carpenter [this message]
2016-03-15  7:26 ` [patch] block-dev: checking for NULL instead of IS_ERR() Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160308120546.GB28684@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shli@fb.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).