public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <christian@brauner.io>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: gregkh@linuxfoundation.org, arve@android.com, tkjos@android.com,
	maco@android.com, joel@joelfernandes.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] binderfs: fix error return code in binderfs_fill_super()
Date: Wed, 16 Jan 2019 06:28:26 +0000	[thread overview]
Message-ID: <20190116062825.thzsb5edkihepgm4@brauner.io> (raw)
In-Reply-To: <20190116062546.ufoeresnwz3wyxiu@brauner.io>

On Wed, Jan 16, 2019 at 07:25:46AM +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")

This Fixes tag is technically wrong since this codepath was introduced
by a commit that is still sitting in Greg's char-misc-linus branch. Not
sure how to handle that though. Might just leave it.

> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.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.
> 
> Thanks!
> Christian
> 
> >  		goto err_without_dentry;
> > +	}
> >  
> >  	inode->i_ino = FIRST_INODE;
> >  	inode->i_fop = &simple_dir_operations;
> > @@ -530,8 +532,10 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent)
> >  	set_nlink(inode, 2);
> >  
> >  	sb->s_root = d_make_root(inode);
> > -	if (!sb->s_root)
> > +	if (!sb->s_root) {
> > +		ret = -ENOMEM;
> >  		goto err_without_dentry;
> > +	}
> >  
> >  	ret = binderfs_binder_ctl_create(sb);
> >  	if (ret)
> > 
> > 
> > 

  reply	other threads:[~2019-01-16  6:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16  2:55 [PATCH -next] binderfs: fix error return code in binderfs_fill_super() Wei Yongjun
2019-01-16  6:25 ` Christian Brauner
2019-01-16  6:28   ` Christian Brauner [this message]
2019-01-16  6:53     ` Greg KH
2019-01-16  8:54   ` Dan Carpenter
2019-01-16  8:34 ` [PATCH -next v2] " Wei Yongjun
2019-01-16  8:41   ` Christian Brauner
2019-01-16  8:45     ` Christian Brauner
2019-01-16 10:39   ` [PATCH v3] " Wei Yongjun
2019-01-16 10:34     ` weiyongjun (A)
2019-01-16 10:42     ` [PATCH v4] " Wei Yongjun

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=20190116062825.thzsb5edkihepgm4@brauner.io \
    --to=christian@brauner.io \
    --cc=arve@android.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joel@joelfernandes.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@android.com \
    --cc=tkjos@android.com \
    --cc=weiyongjun1@huawei.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