mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
perf/arm-cmn: Fix incorrect error check for devm_ioremap()
Check devm_ioremap() return value for NULL instead of ERR_PTR and return
-ENOMEM on failure. devm_ioremap() never returns ERR_PTR, using IS_ERR()
skips the error path and may cause a NULL pointer dereference.
Fixes: 5394396ff5 ("perf/arm-cmn: Stop claiming entire iomem region")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
parent
2f89b7f78c
commit
d49802b661
|
|
@ -2573,8 +2573,8 @@ static int arm_cmn_probe(struct platform_device *pdev)
|
|||
|
||||
/* Map the whole region now, claim the DTCs once we've found them */
|
||||
cmn->base = devm_ioremap(cmn->dev, cfg->start, resource_size(cfg));
|
||||
if (IS_ERR(cmn->base))
|
||||
return PTR_ERR(cmn->base);
|
||||
if (!cmn->base)
|
||||
return -ENOMEM;
|
||||
|
||||
rootnode = arm_cmn_get_root(cmn, cfg);
|
||||
if (rootnode < 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user