projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ca86ea
)
macintosh/macio-adb: check the return value of ioremap()
author
Xie Shaowen
<studentxswpy@163.com>
Tue, 2 Aug 2022 07:41:48 +0000
(15:41 +0800)
committer
Michael Ellerman
<mpe@ellerman.id.au>
Thu, 24 Nov 2022 12:12:18 +0000
(23:12 +1100)
The function ioremap() in macio_init() can fail, so its return value
should be checked.
Fixes:
36874579dbf4c
("[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
drivers/macintosh/macio-adb.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/macintosh/macio-adb.c
b/drivers/macintosh/macio-adb.c
index 3721402582b4fc9422bdd85619e830638fbb8120..55a9f8c3a150e1433edb7384ea9474c4137a4aad 100644
(file)
--- a/
drivers/macintosh/macio-adb.c
+++ b/
drivers/macintosh/macio-adb.c
@@
-108,6
+108,10
@@
int macio_init(void)
return -ENXIO;
}
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->intr.r, 0);