From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: david@ixit.cz, "Lee Jones" <lee@kernel.org>,
"Daniel Thompson" <danielt@kernel.org>,
"Jingoo Han" <jingoohan1@gmail.com>,
"Helge Deller" <deller@gmx.de>,
"Kiran Gunda" <quic_kgunda@quicinc.com>,
"Marco Mattiolo" <marco.mattiolo@hotmail.it>,
"Barnabás Czémán" <barnabas.czeman@mainlining.org>
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
phone-devel@vger.kernel.org,
Joel Selvaraj <foss@joelselvaraj.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v3 1/4] backlight: qcom-wled: Fix NULL pointer dereference in PM callbacks
Date: Mon, 21 Sep 2026 11:27:32 +0200 [thread overview]
Message-ID: <989c8883-c481-4132-b6ca-3a333aa0788a@oss.qualcomm.com> (raw)
In-Reply-To: <20260914-qcom-wled-backlight-v3-1-d69fe9843841@ixit.cz>
On 9/14/26 8:14 PM, David Heidelberg via B4 Relay wrote:
> From: David Heidelberg <david@ixit.cz>
>
> wled_probe() doesn't set the driver data for the platform device.
> As a result, dev_get_drvdata() in wled_remove() will return NULL,
> leading to a NULL pointer dereference afterward.
>
> Set the platform device driver data in wled_probe().
>
> Cc: stable@vger.kernel.org
> Fixes: feeab87b3072 ("backlight: qcom-wled: Add support for short circuit handling")
> Signed-off-by: David Heidelberg <david@ixit.cz>
> ---
> drivers/video/backlight/qcom-wled.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c
> index 650dd95f06ef5..a76158a298335 100644
> --- a/drivers/video/backlight/qcom-wled.c
> +++ b/drivers/video/backlight/qcom-wled.c
> @@ -1747,16 +1747,17 @@ static int wled_probe(struct platform_device *pdev)
>
> memset(&props, 0, sizeof(struct backlight_properties));
> props.type = BACKLIGHT_RAW;
> props.brightness = val;
> props.max_brightness = wled->max_brightness;
> bl = devm_backlight_device_register(&pdev->dev, wled->name,
> &pdev->dev, wled,
> &wled_ops, &props);
> + platform_set_drvdata(pdev, bl);
This does make the pointer non-null, but it stores the wrong object
Konrad
> return PTR_ERR_OR_ZERO(bl);
> };
>
> static void wled_remove(struct platform_device *pdev)
> {
> struct wled *wled = platform_get_drvdata(pdev);
>
> mutex_destroy(&wled->lock);
>
next prev parent reply other threads:[~2026-09-21 9:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 18:14 [PATCH v3 0/4] backlight: qcom-wled: Fix OVP IRQ imbalance and start from the hardware state David Heidelberg via B4 Relay
2026-09-14 18:14 ` [PATCH v3 1/4] backlight: qcom-wled: Fix NULL pointer dereference in PM callbacks David Heidelberg via B4 Relay
2026-09-14 18:34 ` David Heidelberg
2026-09-21 9:27 ` Konrad Dybcio [this message]
2026-09-14 18:14 ` [PATCH v3 2/4] backlight: qcom-wled: Fix WLED3 brightness register stride David Heidelberg via B4 Relay
2026-09-21 9:29 ` Konrad Dybcio
2026-09-14 18:14 ` [PATCH v3 3/4] backlight: qcom-wled: Fix unbalanced OVP IRQ enable at probe David Heidelberg via B4 Relay
2026-09-14 18:14 ` [PATCH v3 4/4] backlight: qcom-wled: Read back the programmed brightness " David Heidelberg via B4 Relay
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=989c8883-c481-4132-b6ca-3a333aa0788a@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=barnabas.czeman@mainlining.org \
--cc=danielt@kernel.org \
--cc=david@ixit.cz \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=foss@joelselvaraj.com \
--cc=jingoohan1@gmail.com \
--cc=lee@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marco.mattiolo@hotmail.it \
--cc=phone-devel@vger.kernel.org \
--cc=quic_kgunda@quicinc.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