Skip to content

Commit e6beb47

Browse files
Haoran Liumpe
authored andcommitted
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
1 parent ba5b952 commit e6beb47

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/powerpc/platforms/powernv/opal-prd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ static bool opal_prd_range_is_valid(uint64_t addr, uint64_t size)
6666
const char *label;
6767

6868
addrp = of_get_address(node, 0, &range_size, NULL);
69+
if (!addrp)
70+
continue;
6971

7072
range_addr = of_read_number(addrp, 2);
7173
range_end = range_addr + range_size;

0 commit comments

Comments
 (0)