[Cluster-devel] [PATCH] fs: gfs2: Fix a null-pointer dereference in gfs2_alloc_inode()

Andreas Gruenbacher agruenba at redhat.com
Wed Jul 24 11:03:53 UTC 2019


On Wed, 24 Jul 2019 at 12:55, Steven Whitehouse <swhiteho at redhat.com> wrote:
> 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,

I'll change that ...

Andreas




More information about the Cluster-devel mailing list