mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
backlight: qcom-wled: Fix NULL pointer dereference in wled_remove()
wled_probe() doesn't set the driver data for the platform device.
As a result, platform_get_drvdata() in wled_remove() will return NULL,
and the first dereference of it crashes on unbind.
Set the platform device driver data in wled_probe().
Cc: stable@vger.kernel.org
Fixes: feeab87b30 ("backlight: qcom-wled: Add support for short circuit handling")
Signed-off-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260921-qcom-wled-backlight-v4-1-bab8c7ef73cb@ixit.cz
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
parent
2cf184caab
commit
1dbd46d4b2
|
|
@ -1680,6 +1680,7 @@ static int wled_probe(struct platform_device *pdev)
|
|||
|
||||
wled->regmap = regmap;
|
||||
wled->dev = &pdev->dev;
|
||||
platform_set_drvdata(pdev, wled);
|
||||
|
||||
wled->version = (uintptr_t)of_device_get_match_data(&pdev->dev);
|
||||
if (!wled->version) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user