Skip to content

Commit 18dbfcd

Browse files
ammarfaizi2mpe
authored andcommitted
powerpc/xive: Add missing null check after calling kmalloc
Commit 930914b ("powerpc/xive: Add a debugfs file to dump internal XIVE state") forgot to add a null check. Add it. Fixes: 930914b ("powerpc/xive: Add a debugfs file to dump internal XIVE state") Signed-off-by: Ammar Faizi <[email protected]> Reviewed-by: Cédric Le Goater <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e57c2fd commit 18dbfcd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/powerpc/sysdev/xive/spapr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,9 @@ static int xive_spapr_debug_show(struct seq_file *m, void *private)
653653
struct xive_irq_bitmap *xibm;
654654
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
655655

656+
if (!buf)
657+
return -ENOMEM;
658+
656659
list_for_each_entry(xibm, &xive_irq_bitmaps, list) {
657660
memset(buf, 0, PAGE_SIZE);
658661
bitmap_print_to_pagebuf(true, buf, xibm->bitmap, xibm->count);

0 commit comments

Comments
 (0)