mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
macintosh/macio-adb: check the return value of ioremap()
The function ioremap() in macio_init() can fail, so its return value
should be checked.
Fixes: 36874579db
("[PATCH] powerpc: macio-adb build fix")
Reported-by: Hacash Robot <hacashRobot@santino.com>
Signed-off-by: Xie Shaowen <studentxswpy@163.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220802074148.3213659-1-studentxswpy@163.com
This commit is contained in:
parent
5ca86eae55
commit
dbaa310573
1 changed files with 4 additions and 0 deletions
|
@ -108,6 +108,10 @@ int macio_init(void)
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
adb = ioremap(r.start, sizeof(struct adb_regs));
|
adb = ioremap(r.start, sizeof(struct adb_regs));
|
||||||
|
if (!adb) {
|
||||||
|
of_node_put(adbs);
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
out_8(&adb->ctrl.r, 0);
|
out_8(&adb->ctrl.r, 0);
|
||||||
out_8(&adb->intr.r, 0);
|
out_8(&adb->intr.r, 0);
|
||||||
|
|
Loading…
Reference in a new issue