mm: check the return value of ioremap() in macio_init()
PATCH 1/1 mm: check the return value of ioremap() in macio_init()
From: Xie Shaowen <[email protected]>
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 <[email protected]>
Signed-off-by Xie Shaowen <[email protected]>
--- drivers/macintosh/macio-adb.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/macintosh/macio-adb.c +4 -0
@@ -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 );
Signature · 1 line
2.25.1
Michael Ellerman
AppliedQuoted 6 lines · On Tue, 2 Aug 2022 15:41:48 +0800, [email protected] wrote:
From: Xie Shaowen <[email protected]>
The function
ioremap()inmacio_init()can fail, so its return value should be checked.
Applied to powerpc/next.
[1/1] mm: check the return value of ioremap() in macio_init()
https://git.kernel.org/powerpc/c/dbaa3105736d4d73063ea0a3b01cd7fafce924e6
cheers