[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190116085455.GD4482@kadam>
Date: Wed, 16 Jan 2019 11:54:55 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Christian Brauner <christian@...uner.io>
Cc: Wei Yongjun <weiyongjun1@...wei.com>, devel@...verdev.osuosl.org,
tkjos@...roid.com, gregkh@...uxfoundation.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
arve@...roid.com, joel@...lfernandes.org, maco@...roid.com
Subject: Re: [PATCH -next] binderfs: fix error return code in
binderfs_fill_super()
On Wed, Jan 16, 2019 at 07:25:47AM +0100, Christian Brauner wrote:
> On Wed, Jan 16, 2019 at 03:01:04AM +0000, Wei Yongjun wrote:
> > Fix to return a negative error code -ENOMEM from the new_inode() and
> > d_make_root() error handling cases instead of 0, as done elsewhere in
> > this function.
> >
> > Fixes: 3ad20fe393b3 ("binder: implement binderfs")
> > Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
> > ---
> > drivers/android/binderfs.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c
> > index 9518e2e..2bf4b2b 100644
> > --- a/drivers/android/binderfs.c
> > +++ b/drivers/android/binderfs.c
> > @@ -519,8 +519,10 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent)
> > sb->s_fs_info = info;
> >
> > inode = new_inode(sb);
> > - if (!inode)
> > + if (!inode) {
> > + ret = -ENOMEM;
>
> Hey, thanks for the patch. Just a nit:
> can you please just do?
>
> ret = -ENOMEM;
> inode = new_inode(sb);
>
> This is more consistent with how we do it everywhere else and let's us
> avoid shoving ret = -ENOMEM into two places.
>
Btw, your style is why you have this bug. I don't have strong feelings
about this either way, I'm just pointing it out.
regards,
dan carpenter
Powered by blists - more mailing lists