From: Jonathan Cameron <jic23@kernel.org>
To: Maud Spierings <maudspierings@gocontroll.com>
Cc: "Maud Spierings via B4 Relay"
<devnull+maudspierings.gocontroll.com@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Christian Heusel" <christian@heusel.eu>,
"Linus Walleij" <linus.walleij@linaro.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v4] iio: common: st_sensors: Fix use of uninitialize device structs
Date: Sat, 28 Jun 2025 18:11:43 +0100 [thread overview]
Message-ID: <20250628181143.05d07d89@jic23-huawei> (raw)
In-Reply-To: <5fc05140-76cd-4f19-bbfe-e27e90f21983@gocontroll.com>
On Mon, 23 Jun 2025 15:27:44 +0200
Maud Spierings <maudspierings@gocontroll.com> wrote:
> On 5/31/25 19:03, Jonathan Cameron wrote:
> > On Tue, 27 May 2025 08:36:08 +0200
> > Maud Spierings via B4 Relay <devnull+maudspierings.gocontroll.com@kernel.org> wrote:
> >
> >> From: Maud Spierings <maudspierings@gocontroll.com>
> >>
> >> Throughout the various probe functions &indio_dev->dev is used before it
> >> is initialized. This caused a kernel panic in st_sensors_power_enable()
> >> when the call to devm_regulator_bulk_get_enable() fails and then calls
> >> dev_err_probe() with the uninitialized device.
> >>
> >> This seems to only cause a panic with dev_err_probe(), dev_err(),
> >> dev_warn() and dev_info() don't seem to cause a panic, but are fixed
> >> as well.
> >>
> >> The issue is reported and traced here: [1]
> >>
> >> Link: https://lore.kernel.org/all/AM7P189MB100986A83D2F28AF3FFAF976E39EA@AM7P189MB1009.EURP189.PROD.OUTLOOK.COM/ [1]
> >> Cc: stable@vger.kernel.org
> >> Signed-off-by: Maud Spierings <maudspierings@gocontroll.com>
> >> ---
> >> When I search for general &indio_dev->dev usage, I see quite a lot more
> >> hits, but I am not sure if there are issues with those too.
> >
> > For probe error messages I'd like to see them all moved over to the parent
> > device but more generally it may make sense to use indio_dev->dev
> >
> > As per the earlier discussion I still wonder if we should harden
> > device_set_deferred_reason() against this condition just as a
> > defense in depth thing.
> >
> > Anyhow, this is a good change in any case. Applied to the fixes-togreg-for-6.16 branch
> > that I'll rebase on rc1 once available.
>
> Hi, I've not seen this patch pass by in the stable tree or will this get
> submitted for 6.17-rc1?
I'm just being a bit slow this cycle. I'll send a fixes pull request out
soonish then it'll go into 6.16-rcX and after that get pulled back into stable.
Jonathan
>
> Sorry if I am being too impatient.
>
> kind regards,
> Maud
prev parent reply other threads:[~2025-06-28 17:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 6:36 [PATCH v4] iio: common: st_sensors: Fix use of uninitialize device structs Maud Spierings via B4 Relay
2025-05-27 8:18 ` Andy Shevchenko
2025-05-31 17:03 ` Jonathan Cameron
2025-06-23 13:27 ` Maud Spierings
2025-06-28 17:11 ` Jonathan Cameron [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=20250628181143.05d07d89@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=christian@heusel.eu \
--cc=devnull+maudspierings.gocontroll.com@kernel.org \
--cc=dlechner@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maudspierings@gocontroll.com \
--cc=nuno.sa@analog.com \
--cc=stable@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