From: Steven Whitehouse Date: Wed, 24 Jul 2019 11:55:02 +0100 Subject: [Cluster-devel] [PATCH] fs: gfs2: Fix a null-pointer dereference in gfs2_alloc_inode() In-Reply-To: <20190724102718.GA30071@infradead.org> References: <20190724084303.1236-1-baijiaju1990@gmail.com> <2986ed32-9aad-8e9c-1373-1402b34e65ac@redhat.com> <20190724100207.GA7916@infradead.org> <380199a4-1864-d61a-1b9c-f21d4f3f8a32@redhat.com> <20190724102718.GA30071@infradead.org> Message-ID: <42a3501a-ff02-2b3d-850f-4ee1c014d815@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, On 24/07/2019 11:27, Christoph Hellwig wrote: > On Wed, Jul 24, 2019 at 11:22:46AM +0100, Steven Whitehouse wrote: >> and it would have the same effect, so far as I can tell. I don't mind >> changing it, if that is perhaps a clearer way to write the same thing, >> rather than &ip->i_inode; > The cleanest thing is to not rely on any of that magic and write it > like all other file systems: > > ip = kmem_cache_alloc > if (!ip) > retuturn NULL; > > ... > > return &ip->i_inode; > > Absolutely not point in trying to be clever here. Yes, that works too, Steve.