You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
powerpc/xive: Add missing null check after calling kmalloc
[ Upstream commit18dbfcdedc] Commit930914b7d5("powerpc/xive: Add a debugfs file to dump internal XIVE state") forgot to add a null check. Add it. Fixes:930914b7d5("powerpc/xive: Add a debugfs file to dump internal XIVE state") Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20211226135314.251221-1-ammar.faizi@intel.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
588e0b81ce
commit
74988d017d
@@ -658,6 +658,9 @@ static int xive_spapr_debug_show(struct seq_file *m, void *private)
|
||||
struct xive_irq_bitmap *xibm;
|
||||
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
list_for_each_entry(xibm, &xive_irq_bitmaps, list) {
|
||||
memset(buf, 0, PAGE_SIZE);
|
||||
bitmap_print_to_pagebuf(true, buf, xibm->bitmap, xibm->count);
|
||||
|
||||
Reference in New Issue
Block a user