linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: cgxu519 <cgxu519@gmx.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [bug report] chardev: code cleanup for __register_chrdev_region()
Date: Fri, 5 Apr 2019 19:32:15 +0800	[thread overview]
Message-ID: <1e9766ee-a999-e9d6-0305-3675baa9003d@gmx.com> (raw)
In-Reply-To: <20190405045752.GR32613@kadam>

On 4/5/19 12:57 PM, Dan Carpenter wrote:
> 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.
Yes, that's better. I'll send v3 version.


Thanks,
Chengguang.

      reply	other threads:[~2019-04-05 11:32 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
2019-04-05 11:32     ` cgxu519 [this message]

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=1e9766ee-a999-e9d6-0305-3675baa9003d@gmx.com \
    --to=cgxu519@gmx.com \
    --cc=dan.carpenter@oracle.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).