All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Christian Brauner <christian@brauner.io>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	devel@driverdev.osuosl.org, tkjos@android.com,
	gregkh@linuxfoundation.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org, arve@android.com,
	joel@joelfernandes.org, maco@android.com
Subject: Re: [PATCH -next] binderfs: fix error return code in binderfs_fill_super()
Date: Wed, 16 Jan 2019 08:54:55 +0000	[thread overview]
Message-ID: <20190116085455.GD4482@kadam> (raw)
In-Reply-To: <20190116062546.ufoeresnwz3wyxiu@brauner.io>

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@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.
> 

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

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Christian Brauner <christian@brauner.io>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	devel@driverdev.osuosl.org, tkjos@android.com,
	gregkh@linuxfoundation.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org, arve@android.com,
	joel@joelfernandes.org, maco@android.com
Subject: Re: [PATCH -next] binderfs: fix error return code in binderfs_fill_super()
Date: Wed, 16 Jan 2019 11:54:55 +0300	[thread overview]
Message-ID: <20190116085455.GD4482@kadam> (raw)
In-Reply-To: <20190116062546.ufoeresnwz3wyxiu@brauner.io>

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@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.
> 

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


  parent reply	other threads:[~2019-01-16  8:54 UTC|newest]

Thread overview: 21+ 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  3:01 ` Wei Yongjun
2019-01-16  6:25 ` Christian Brauner
2019-01-16  6:25   ` Christian Brauner
2019-01-16  6:28   ` Christian Brauner
2019-01-16  6:28     ` Christian Brauner
2019-01-16  6:53     ` Greg KH
2019-01-16  6:53       ` Greg KH
2019-01-16  8:54   ` Dan Carpenter [this message]
2019-01-16  8:54     ` Dan Carpenter
2019-01-16  8:34 ` [PATCH -next v2] " Wei Yongjun
2019-01-16  8:34   ` Wei Yongjun
2019-01-16  8:41   ` Christian Brauner
2019-01-16  8:41     ` Christian Brauner
2019-01-16  8:45     ` Christian Brauner
2019-01-16  8:45       ` Christian Brauner
2019-01-16 10:39   ` [PATCH v3] " Wei Yongjun
2019-01-16 10:39     ` Wei Yongjun
2019-01-16 10:34     ` weiyongjun (A)
2019-01-16 10:42     ` [PATCH v4] " Wei Yongjun
2019-01-16 10:42       ` 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=20190116085455.GD4482@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=arve@android.com \
    --cc=christian@brauner.io \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.