All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: Guenter Roeck <linux@roeck-us.net>,
	<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: Sun, 24 Apr 2022 14:20:58 +0800	[thread overview]
Message-ID: <8355e6fe-0271-eba1-c256-a5582a8e01f9@huawei.com> (raw)
In-Reply-To: <e6fdd042-a84e-ef0d-a042-df04c3fb84e1@roeck-us.net>


On 2022/4/24 12:54, Guenter Roeck wrote:
> 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.
Yes, it does, thanks for pointing it out.
>
> Guenter
>
> .

      reply	other threads:[~2022-04-24  6:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22  9:11 [PATCH 00/20] hwmon: check return value after calling platform_get_resource() 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
2022-04-24  6:20       ` Yang Yingliang [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=8355e6fe-0271-eba1-c256-a5582a8e01f9@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.