diff options
| author | David Heidelberg <david@ixit.cz> | 2026-09-03 17:21:42 +0200 |
|---|---|---|
| committer | Lee Jones <lee@kernel.org> | 2026-09-24 15:12:45 +0100 |
| commit | dcf0e640b553d33512fbcaedb909c32ba9636a64 (patch) | |
| tree | a17ea2a6f9d85bb1ac44c5989a068fbfa9e05dfc /drivers | |
| parent | b296be1dc008fe3a536341afae01f66bb302e67f (diff) | |
mfd: wcd934x: Fix NULL pointer dereference on IRQ probe deferral
ddata->dev is only assigned at the end of wcd934x_slim_probe(), but the
of_irq_get() error path has passed it to the error print since the
driver was added, while it is still NULL.
This used to be harmless with dev_err(), which copes with a NULL device
and was skipped on -EPROBE_DEFER. Since the switch to dev_err_probe(), a
deferred IRQ reaches device_set_deferred_probe_reason() ->
dev_driver_string(), which dereferences the NULL pointer and crashes
during probe. Use dev, which is already valid at this point.
Cc: stable@vger.kernel.org
Fixes: 0f1b1b899521 ("mfd: wcd934x: Simplify with dev_err_probe()")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/mfd/20260903145651.AC1311F00ACA@smtp.kernel.org/
Signed-off-by: David Heidelberg <david@ixit.cz>
Link: https://patch.msgid.link/20260903-wcd-dma-v3-1-d3920c6563c4@ixit.cz
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/mfd/wcd934x.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/wcd934x.c b/drivers/mfd/wcd934x.c index 7bea64fc0956..d57796933d87 100644 --- a/drivers/mfd/wcd934x.c +++ b/drivers/mfd/wcd934x.c @@ -229,7 +229,7 @@ static int wcd934x_slim_probe(struct slim_device *sdev) ddata->irq = of_irq_get(np, 0); if (ddata->irq < 0) - return dev_err_probe(ddata->dev, ddata->irq, + return dev_err_probe(dev, ddata->irq, "Failed to get IRQ\n"); ddata->extclk = devm_clk_get(dev, "extclk"); |
