mirror of
https://github.com/torvalds/linux.git
synced 2026-09-12 20:53:03 +02:00
accel/ethosu: check MMIO mapping errors in probe
devm_platform_ioremap_resource() returns an error pointer when the register
resource cannot be mapped. ethosu_probe() stores it and continues until
initialization dereferences it through MMIO accessors.
Return the mapping error before initializing the device.
Fixes: 5a5e9c0228 ("accel: Add Arm Ethos-U NPU driver")
Cc: stable@vger.kernel.org
Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn>
Link: https://patch.msgid.link/20260716065219.931088-1-zhaoguohan@kylinos.cn
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
This commit is contained in:
parent
7e33ba3a1d
commit
7ab64476a6
|
|
@ -342,6 +342,8 @@ static int ethosu_probe(struct platform_device *pdev)
|
|||
dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(40));
|
||||
|
||||
ethosudev->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(ethosudev->regs))
|
||||
return PTR_ERR(ethosudev->regs);
|
||||
|
||||
ethosudev->num_clks = devm_clk_bulk_get_all(&pdev->dev, ðosudev->clks);
|
||||
if (ethosudev->num_clks < 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user