public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Kulikov Vasiliy <segooon@gmail.com>
To: kernel-janitors@vger.kernel.org
Cc: Vasiliy Kulikov <segooon@gmail.com>,
	Jeff Dike <jdike@addtoit.com>, Al Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@lst.de>,
	user-mode-linux-devel@lists.sourceforge.net,
	user-mode-linux-user@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [PATCH 10/14] hppfs: check for IS_ERR() instead of != NULL
Date: Sun, 05 Sep 2010 18:32:56 +0000	[thread overview]
Message-ID: <1283711577-7505-1-git-send-email-segooon@gmail.com> (raw)

From: Vasiliy Kulikov <segooon@gmail.com>

Function get_inode may return ERR_PTR(...). Check for it.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
 Compile tested.

 fs/hppfs/hppfs.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c
index 7b02772..e7d6535 100644
--- a/fs/hppfs/hppfs.c
+++ b/fs/hppfs/hppfs.c
@@ -173,7 +173,7 @@ static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
 
 	err = -ENOMEM;
 	inode = get_inode(ino->i_sb, proc_dentry);
-	if (!inode)
+	if (IS_ERR_OR_NULL(inode))
 		goto out_dput;
 
  	d_add(dentry, inode);
@@ -730,7 +730,7 @@ static int hppfs_fill_super(struct super_block *sb, void *d, int silent)
 
 	err = -ENOMEM;
 	root_inode = get_inode(sb, proc_mnt->mnt_sb->s_root);
-	if (!root_inode)
+	if (IS_ERR_OR_NULL(root_inode))
 		goto out_mntput;
 
 	sb->s_root = d_alloc_root(root_inode);
-- 
1.7.0.4


             reply	other threads:[~2010-09-05 18:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-05 18:32 Kulikov Vasiliy [this message]
2010-09-08 20:11 ` [PATCH 10/14] hppfs: check for IS_ERR() instead of != NULL Andrew Morton

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=1283711577-7505-1-git-send-email-segooon@gmail.com \
    --to=segooon@gmail.com \
    --cc=hch@lst.de \
    --cc=jdike@addtoit.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=user-mode-linux-user@lists.sourceforge.net \
    --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