summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHaoran Liu <liuhaoran14@163.com>2023-11-27 06:41:08 -0800
committerMichael Ellerman <mpe@ellerman.id.au>2023-12-21 22:16:21 +1100
commite6beb47edb89ca9dc8906515e2dfbeb5913312c8 (patch)
tree9b94403c2816f03146c434eb69cb0275c22b567e /arch
parentba5b952ad5f52e58c0f288b9d5427ad734600568 (diff)
downloadlinux-e6beb47edb89ca9dc8906515e2dfbeb5913312c8.tar.gz
linux-e6beb47edb89ca9dc8906515e2dfbeb5913312c8.tar.bz2
linux-e6beb47edb89ca9dc8906515e2dfbeb5913312c8.zip
powerpc/powernv: Add error handling to opal_prd_range_is_valid
In the opal_prd_range_is_valid function within opal-prd.c, error handling was missing for the of_get_address call. This patch adds necessary error checking, ensuring that the function gracefully handles scenarios where of_get_address fails. Signed-off-by: Haoran Liu <liuhaoran14@163.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20231127144108.29782-1-liuhaoran14@163.com
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/powernv/opal-prd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-prd.c b/arch/powerpc/platforms/powernv/opal-prd.c
index 327e2f76905d..b66b06efcef1 100644
--- a/arch/powerpc/platforms/powernv/opal-prd.c
+++ b/arch/powerpc/platforms/powernv/opal-prd.c
@@ -66,6 +66,8 @@ static bool opal_prd_range_is_valid(uint64_t addr, uint64_t size)
const char *label;
addrp = of_get_address(node, 0, &range_size, NULL);
+ if (!addrp)
+ continue;
range_addr = of_read_number(addrp, 2);
range_end = range_addr + range_size;