linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: cgxu519 <cgxu519@gmx.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [bug report] chardev: code cleanup for __register_chrdev_region()
Date: Thu, 4 Apr 2019 21:57:52 -0700 (PDT)	[thread overview]
Message-ID: <20190405045752.GR32613@kadam> (raw)
In-Reply-To: <bea4fc52-2b2e-9090-1b81-a03bee6e54e5@gmx.com>

On Fri, Apr 05, 2019 at 07:13:00AM +0800, cgxu519 wrote:
> On 4/5/19 3:08 AM, Dan Carpenter wrote:
> > Hello Chengguang Xu,
> > 
> > The patch 4b0be5726032: "chardev: code cleanup for
> > __register_chrdev_region()" from Feb 15, 2019, leads to the following
> > static checker warning:
> > 
> > 	fs/char_dev.c:167 __register_chrdev_region()
> > 	error: passing non negative 511 to ERR_PTR
> 
> Hi Dan,
> 
> Thanks for your report,  I would like to know how did you trigger this?

This a Smatch warning but you probably need to have the cross function
DB built to see it.

> IIUC, in the case of allocating dynamic major will not fail from minor
> overlap check.

Fine, but it's harmless to set "ret = -EBUSY;" before the goto out just
to silence the warning.  It would make the code more easy to understand
as well.

regards,
dan carpenter


  reply	other threads:[~2019-04-05  4:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 19:08 [bug report] chardev: code cleanup for __register_chrdev_region() Dan Carpenter
2019-04-04 23:13 ` cgxu519
2019-04-05  4:57   ` Dan Carpenter [this message]
2019-04-05 11:32     ` cgxu519

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=20190405045752.GR32613@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=cgxu519@gmx.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).