Skip to content

Commit 864b23f

Browse files
austindhkimIngo Molnar
authored andcommitted
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]>
1 parent f49dcd1 commit 864b23f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/platform/uv/tlb_uv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,9 +1804,9 @@ static void pq_init(int node, int pnode)
18041804

18051805
plsize = (DEST_Q_SIZE + 1) * sizeof(struct bau_pq_entry);
18061806
vp = kmalloc_node(plsize, GFP_KERNEL, node);
1807-
pqp = (struct bau_pq_entry *)vp;
1808-
BUG_ON(!pqp);
1807+
BUG_ON(!vp);
18091808

1809+
pqp = (struct bau_pq_entry *)vp;
18101810
cp = (char *)pqp + 31;
18111811
pqp = (struct bau_pq_entry *)(((unsigned long)cp >> 5) << 5);
18121812

0 commit comments

Comments
 (0)