From: Guenter Roeck <linux@roeck-us.net>
To: Yang Yingliang <yangyingliang@huawei.com>,
linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org
Cc: jdelvare@suse.com
Subject: Re: [PATCH 00/20] hwmon: check return value after calling platform_get_resource()
Date: Sat, 23 Apr 2022 21:54:16 -0700 [thread overview]
Message-ID: <e6fdd042-a84e-ef0d-a042-df04c3fb84e1@roeck-us.net> (raw)
In-Reply-To: <c40e9bff-e28c-58c3-dc09-1a10f24ad440@huawei.com>
On 4/23/22 20:35, Yang Yingliang wrote:
> Hi,
>
> On 2022/4/22 21:27, Guenter Roeck wrote:
>> On 4/22/22 02:11, Yang Yingliang wrote:
>>> This patcheset add check after calling platform_get_resource to avoid null-ptr-deref
>>> in drivers/hwmon/.
>>>
>>> Yang Yingliang (20):
>>> hwmon: (abituguru) check return value after calling
>>> platform_get_resource()
>>> hwmon: (abituguru3) check return value after calling
>>> platform_get_resource()
>>> hwmon: (dme1737) check return value after calling
>>> platform_get_resource()
>>> hwmon: (f71805f) check return value after calling
>>> platform_get_resource()
>>> hwmon: (f71882fg) check return value after calling
>>> platform_get_resource()
>>> hwmon: (it87) check return value after calling platform_get_resource()
>>> hwmon: (lm78) check return value after calling platform_get_resource()
>>> hwmon: (nct6683) check return value after calling
>>> platform_get_resource()
>>> hwmon: (nct6775) check return value after calling
>>> platform_get_resource()
>>> hwmon: (sch5627) check return value after calling
>>> platform_get_resource()
>>> hwmon: (sch5636) check return value after calling
>>> platform_get_resource()
>>> hwmon: (sis5595) check return value after calling
>>> platform_get_resource()
>>> hwmon: (smsc47b397) check return value after calling
>>> platform_get_resource()
>>> hwmon: (smsc47m1) check return value after calling
>>> platform_get_resource()
>>> hwmon: (via686a) check return value after calling
>>> platform_get_resource()
>>> hwmon: (vt1211) check return value after calling
>>> platform_get_resource()
>>> hwmon: (vt8231) check return value after calling
>>> platform_get_resource()
>>> hwmon: (w83627ehf) check return value after calling
>>> platform_get_resource()
>>> hwmon: (w83627hf) check return value after calling
>>> platform_get_resource()
>>> hwmon: (w83781d) check return value after calling
>>> platform_get_resource()
>>>
>>> drivers/hwmon/abituguru.c | 6 +++++-
>>> drivers/hwmon/abituguru3.c | 6 +++++-
>>> drivers/hwmon/dme1737.c | 2 ++
>>> drivers/hwmon/f71805f.c | 2 ++
>>> drivers/hwmon/f71882fg.c | 6 +++++-
>>> drivers/hwmon/it87.c | 2 ++
>>> drivers/hwmon/lm78.c | 2 ++
>>> drivers/hwmon/nct6683.c | 2 ++
>>> drivers/hwmon/nct6775.c | 2 ++
>>> drivers/hwmon/sch5627.c | 6 +++++-
>>> drivers/hwmon/sch5636.c | 6 +++++-
>>> drivers/hwmon/sis5595.c | 2 ++
>>> drivers/hwmon/smsc47b397.c | 2 ++
>>> drivers/hwmon/smsc47m1.c | 2 ++
>>> drivers/hwmon/via686a.c | 2 ++
>>> drivers/hwmon/vt1211.c | 2 ++
>>> drivers/hwmon/vt8231.c | 2 ++
>>> drivers/hwmon/w83627ehf.c | 2 ++
>>> drivers/hwmon/w83627hf.c | 2 ++
>>> drivers/hwmon/w83781d.c | 2 ++
>>> 20 files changed, 55 insertions(+), 5 deletions(-)
>>>
>>
>> This series solves a problem which does not exist in reality and is only theoretic.
>> The devices are instantiated from their init functions which always adds the resource.
>> Please do not submit such patches.
> As you said the resource will be add in init functions, I checked these drivers, the driver
> sch5627 and sch5636 won't add resource, so need I send patches to fix these drivers ?
>
You might want to read the code more carefully. The drivers are instantiated
from drivers/hwmon/sch56xx-common.c which does add the resource.
Guenter
next prev parent reply other threads:[~2022-04-24 4:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-22 9:11 Yang Yingliang
2022-04-22 9:11 ` [PATCH 01/20] hwmon: (abituguru) " Yang Yingliang
2022-04-22 9:11 ` [PATCH 02/20] hwmon: (abituguru3) " Yang Yingliang
2022-04-22 9:11 ` [PATCH 03/20] hwmon: (dme1737) " Yang Yingliang
2022-04-22 9:11 ` [PATCH 04/20] hwmon: (f71805f) " Yang Yingliang
2022-04-22 9:11 ` [PATCH 05/20] hwmon: (f71882fg) " Yang Yingliang
2022-04-22 9:11 ` [PATCH 06/20] hwmon: (it87) " Yang Yingliang
2022-04-22 9:11 ` [PATCH 07/20] hwmon: (lm78) " Yang Yingliang
2022-04-22 9:11 ` [PATCH 08/20] hwmon: (nct6683) " Yang Yingliang
2022-04-22 9:11 ` [PATCH 09/20] hwmon: (nct6775) " Yang Yingliang
2022-04-22 9:11 ` [PATCH 10/20] hwmon: (sch5627) " Yang Yingliang
2022-04-22 9:11 ` [PATCH 11/20] hwmon: (sch5636) " Yang Yingliang
2022-04-22 9:11 ` [PATCH 12/20] hwmon: (sis5595) " Yang Yingliang
2022-04-22 9:12 ` [PATCH 13/20] hwmon: (smsc47b397) " Yang Yingliang
2022-04-22 9:12 ` [PATCH 14/20] hwmon: (smsc47m1) " Yang Yingliang
2022-04-22 9:12 ` [PATCH 15/20] hwmon: (via686a) " Yang Yingliang
2022-04-22 9:12 ` [PATCH 16/20] hwmon: (vt1211) " Yang Yingliang
2022-04-22 9:12 ` [PATCH 17/20] hwmon: (vt8231) " Yang Yingliang
2022-04-22 9:12 ` [PATCH 18/20] hwmon: (w83627ehf) " Yang Yingliang
2022-04-22 9:12 ` [PATCH 19/20] hwmon: (w83627hf) " Yang Yingliang
2022-04-22 9:12 ` [PATCH 20/20] hwmon: (w83781d) " Yang Yingliang
2022-04-22 13:27 ` [PATCH 00/20] hwmon: " Guenter Roeck
2022-04-24 3:35 ` Yang Yingliang
2022-04-24 4:54 ` Guenter Roeck [this message]
2022-04-24 6:20 ` Yang Yingliang
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=e6fdd042-a84e-ef0d-a042-df04c3fb84e1@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yangyingliang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®