aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Kim <[email protected]>2019-09-06 08:29:51 +0900
committerIngo Molnar <[email protected]>2019-09-06 07:36:16 +0200
commit864b23f0169d5bff677e8443a7a90dfd6b090afc (patch)
tree3d598afa5ff0ed95fe38bf180ee0650de7ca407a
parentf49dcd1aba4374c56bc77100e2d146884d2238c1 (diff)
x86/platform/uv: Fix kmalloc() NULL check routine
The result of kmalloc() should have been checked ahead of below statement: pqp = (struct bau_pq_entry *)vp; Move BUG_ON(!vp) before above statement. Signed-off-by: Austin Kim <[email protected]> Cc: Dimitri Sivanich <[email protected]> Cc: Hedi Berriche <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mike Travis <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Russ Anderson <[email protected]> Cc: Steve Wahl <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/20190905232951.GA28779@LGEARND20B15 Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--arch/x86/platform/uv/tlb_uv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index 20c389a91b80..5f0a96bf27a1 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -1804,9 +1804,9 @@ static void pq_init(int node, int pnode)
plsize = (DEST_Q_SIZE + 1) * sizeof(struct bau_pq_entry);
vp = kmalloc_node(plsize, GFP_KERNEL, node);
- pqp = (struct bau_pq_entry *)vp;
- BUG_ON(!pqp);
+ BUG_ON(!vp);
+ pqp = (struct bau_pq_entry *)vp;
cp = (char *)pqp + 31;
pqp = (struct bau_pq_entry *)(((unsigned long)cp >> 5) << 5);