From: Christoph Hellwig <hch@infradead.org>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: rpeterso@redhat.com, agruenba@redhat.com,
cluster-devel@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: gfs2: Fix a null-pointer dereference in gfs2_alloc_inode()
Date: Wed, 24 Jul 2019 03:00:30 -0700 [thread overview]
Message-ID: <20190724100030.GA2239@infradead.org> (raw)
In-Reply-To: <20190724084303.1236-1-baijiaju1990@gmail.com>
On Wed, Jul 24, 2019 at 04:43:03PM +0800, Jia-Ju Bai wrote:
> index 0acc5834f653..c07c3f4f8451 100644
> --- a/fs/gfs2/super.c
> +++ b/fs/gfs2/super.c
> @@ -1728,8 +1728,9 @@ static struct inode *gfs2_alloc_inode(struct super_block *sb)
> memset(&ip->i_res, 0, sizeof(ip->i_res));
> RB_CLEAR_NODE(&ip->i_res.rs_node);
> ip->i_rahead = 0;
> - }
> - return &ip->i_inode;
> + return &ip->i_inode;
> + } else
> + return NULL;
> }
No need for an else after a return. You probably just want to
return early for the NULL case.
prev parent reply other threads:[~2019-07-24 10:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-24 8:43 [PATCH] fs: gfs2: Fix a null-pointer dereference in gfs2_alloc_inode() Jia-Ju Bai
2019-07-24 10:00 ` Christoph Hellwig [this message]
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=20190724100030.GA2239@infradead.org \
--to=hch@infradead.org \
--cc=agruenba@redhat.com \
--cc=baijiaju1990@gmail.com \
--cc=cluster-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpeterso@redhat.com \
/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