From: Paul Cercueil <paul@crapouillou.net>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Dan Carpenter <dan.carpenter@oracle.com>, linux-hwmon@vger.kernel.org
Subject: Re: [bug report] hwmon: Add "label" attribute
Date: Thu, 27 Jan 2022 16:43:10 +0000 [thread overview]
Message-ID: <YRND6R.QOHHPJC4LTBW1@crapouillou.net> (raw)
In-Reply-To: <73331bd3-a252-4e11-e84c-8dfad3f62eb0@roeck-us.net>
Hi Guenter,
Le jeu., janv. 27 2022 at 06:28:26 -0800, Guenter Roeck
<linux@roeck-us.net> a écrit :
> On 1/27/22 01:47, Paul Cercueil wrote:
>> Hi,
>>
>> Le jeu., janv. 27 2022 at 11:52:45 +0300, Dan Carpenter
>> <dan.carpenter@oracle.com> a écrit :
>>> Hello Paul Cercueil,
>>>
>>> This is a semi-automatic email about new static checker warnings.
>>>
>>> The patch 073c3ea6c530: "hwmon: Add "label" attribute" from Jan 10,
>>> 2022, leads to the following Smatch complaint:
>>>
>>> drivers/hwmon/hwmon.c:825 __hwmon_device_register()
>>> warn: variable dereferenced before check 'dev' (see line 810)
>>>
>>> drivers/hwmon/hwmon.c
>>> 809
>>> 810 if (device_property_present(dev, "label")) {
>>> ^^^
>>> The patch adds a new unchecked dereference
>>
>> I will send a patch to address that.
>>
>> I'm surprised that this function can be called with dev == NULL in
>> the first place, though.
>>
>
> Originally it was needed for the thermal subsystem, which did not
> provide a parent
> device. By the time that was reworked, it was (mis-)used by the
> Loongson-3 hwmon
> driver (which was never reviewed by a hwmon maintainer and does
> pretty much
> everything wrong).
Where is that Loongson-3 hwmon driver? I can't find it anywhere.
Maybe we can change that now?
-Paul
next prev parent reply other threads:[~2022-01-27 16:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 8:52 [bug report] hwmon: Add "label" attribute Dan Carpenter
2022-01-27 9:47 ` Paul Cercueil
2022-01-27 14:28 ` Guenter Roeck
2022-01-27 16:43 ` Paul Cercueil [this message]
2022-01-27 17:17 ` Guenter Roeck
2022-01-31 16:27 ` [PATCH] hwmon: Fix possible NULL pointer Paul Cercueil
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=YRND6R.QOHHPJC4LTBW1@crapouillou.net \
--to=paul@crapouillou.net \
--cc=dan.carpenter@oracle.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
/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