From: James Seo <james@equiv.tech>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [bug report] hwmon: add HP WMI Sensors driver
Date: Tue, 25 Jul 2023 01:52:28 -0700 [thread overview]
Message-ID: <ZL+NTFzWEmJCMg94@equiv.tech> (raw)
In-Reply-To: <f72c129b-8c57-406a-bf41-bd889b65ea0f@moroto.mountain>
On Tue, Jul 25, 2023 at 08:17:50AM +0300, Dan Carpenter wrote:
> Hello James Seo,
>
> The patch 23902f98f8d4: "hwmon: add HP WMI Sensors driver" from May
> 22, 2023 (linux-next), leads to the following Smatch static checker
> warning:
>
> drivers/hwmon/hp-wmi-sensors.c:1937 hp_wmi_sensors_init()
> error: uninitialized symbol 'pevents'.
>
> drivers/hwmon/hp-wmi-sensors.c
> 1913 static int hp_wmi_sensors_init(struct hp_wmi_sensors *state)
> 1914 {
> 1915 struct hp_wmi_info *connected[HP_WMI_MAX_INSTANCES];
> 1916 struct hp_wmi_platform_events *pevents;
> 1917 struct device *dev = &state->wdev->dev;
> 1918 struct hp_wmi_info *info;
> 1919 struct device *hwdev;
> 1920 bool has_events;
> 1921 bool is_new;
> 1922 u8 icount;
> 1923 u8 pcount;
> 1924 u8 count;
> 1925 int err;
> 1926
> 1927 err = init_platform_events(dev, &pevents, &pcount);
> 1928 if (err)
> 1929 return err;
> 1930
> 1931 err = init_numeric_sensors(state, connected, &info,
> 1932 &icount, &count, &is_new);
> 1933 if (err)
> 1934 return err;
> 1935
> 1936 if (IS_ENABLED(CONFIG_DEBUG_FS))
> --> 1937 hp_wmi_debugfs_init(dev, info, pevents, icount, pcount, is_new);
>
> In this code prevents is uninitialized if pcount is zero. It's not used
> so whether this is a bug or not depends on if hp_wmi_debugfs_init() is
> inlined. If it's inlined then it's not a bug, but if it isn't then it's
> still a bug (despite that pevents is not used).
>
Hi Dan,
I appreciate your report and will address this shortly.
James
>
> regards,
> dan carpenter
prev parent reply other threads:[~2023-07-25 8:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 5:17 [bug report] hwmon: add HP WMI Sensors driver Dan Carpenter
2023-07-25 8:52 ` James Seo [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=ZL+NTFzWEmJCMg94@equiv.tech \
--to=james@equiv.tech \
--cc=dan.carpenter@linaro.org \
--cc=linux-hwmon@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