public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Omar Sandoval <osandov@osandov.com>
Cc: linux-kernel@vger.kernel.org, "Ed L. Cashin" <ed.cashin@acm.org>,
	Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org
Subject: Re: [PATCH] block: aoe: no need to check return value of debugfs_create functions
Date: Wed, 23 Jan 2019 07:41:18 +0100	[thread overview]
Message-ID: <20190123064118.GC26046@kroah.com> (raw)
In-Reply-To: <20190122232933.GC5884@vader>

On Tue, Jan 22, 2019 at 03:29:33PM -0800, Omar Sandoval wrote:
> On Tue, Jan 22, 2019 at 04:21:04PM +0100, Greg Kroah-Hartman wrote:
> > When calling debugfs functions, there is no need to ever check the
> > return value.  The function can work or not, but the code logic should
> > never do something different based on this.
> > 
> > Cc: "Ed L. Cashin" <ed.cashin@acm.org>
> > Cc: Jens Axboe <axboe@kernel.dk>
> > Cc: linux-block@vger.kernel.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >  drivers/block/aoe/aoeblk.c | 13 +------------
> >  1 file changed, 1 insertion(+), 12 deletions(-)
> > 
> > diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
> > index e2c6aae2d636..b602646bfa04 100644
> > --- a/drivers/block/aoe/aoeblk.c
> > +++ b/drivers/block/aoe/aoeblk.c
> > @@ -207,14 +207,7 @@ aoedisk_add_debugfs(struct aoedev *d)
> >  	else
> >  		p++;
> >  	BUG_ON(*p == '\0');
> > -	entry = debugfs_create_file(p, 0444, aoe_debugfs_dir, d,
> > -				    &aoe_debugfs_fops);
> > -	if (IS_ERR_OR_NULL(entry)) {
> > -		pr_info("aoe: cannot create debugfs file for %s\n",
> > -			d->gd->disk_name);
> > -		return;
> > -	}
> > -	BUG_ON(d->debugfs);
> > +	debugfs_create_file(p, 0444, aoe_debugfs_dir, d, &aoe_debugfs_fops);
> >  	d->debugfs = entry;
> 
> Now entry is uninitialized here when we assign it to d->debugfs.

Ah, good catch, I'll go fix this up and post a v2, sorry about that.

greg k-h

  parent reply	other threads:[~2019-01-23  6:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 15:21 [PATCH] block: aoe: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-01-22 23:29 ` Omar Sandoval
2019-01-23  0:31   ` Ed Cashin
2019-01-23  6:41   ` Greg Kroah-Hartman [this message]
2019-06-03 14:25 ` [PATCH v2] " Greg Kroah-Hartman
2019-06-03 19:47 ` [PATCH v3] " Greg Kroah-Hartman
2019-06-04 18:09   ` Justin Sanders
2019-06-04 19:38   ` Jens Axboe

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=20190123064118.GC26046@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=axboe@kernel.dk \
    --cc=ed.cashin@acm.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osandov@osandov.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