projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f1750bf
)
powerpc/xive: Add missing null check after calling kmalloc
author
Ammar Faizi
<ammarfaizi2@gmail.com>
Sun, 26 Dec 2021 13:54:02 +0000
(20:54 +0700)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:18 +0000
(11:04 +0100)
[ Upstream commit
18dbfcdedc802f9500b2c29794f22a31d27639c0
]
Commit
930914b7d528fc
("powerpc/xive: Add a debugfs file to dump
internal XIVE state") forgot to add a null check.
Add it.
Fixes: 930914b7d528fc6b0249bffc00564100bcf6ef75 ("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>
arch/powerpc/sysdev/xive/spapr.c
patch
|
blob
|
history
diff --git
a/arch/powerpc/sysdev/xive/spapr.c
b/arch/powerpc/sysdev/xive/spapr.c
index f143b6f111ac0a2b0efcbf61a757d8cfe4aa3f94..1179632560b8d87a3c5e18cdac719d37c8d03c32 100644
(file)
--- a/
arch/powerpc/sysdev/xive/spapr.c
+++ b/
arch/powerpc/sysdev/xive/spapr.c
@@
-653,6
+653,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);