[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190922185934.4305-51-sashal@kernel.org>
Date: Sun, 22 Sep 2019 14:59:24 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Austin Kim <austindh.kim@...il.com>,
Dimitri Sivanich <dimitri.sivanich@....com>,
Hedi Berriche <hedi.berriche@....com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Mike Travis <mike.travis@....com>,
Peter Zijlstra <peterz@...radead.org>,
Russ Anderson <russ.anderson@....com>,
Steve Wahl <steve.wahl@....com>,
Thomas Gleixner <tglx@...utronix.de>, allison@...utok.net,
andy@...radead.org, armijn@...ldur.nl, bp@...en8.de,
dvhart@...radead.org, gregkh@...uxfoundation.org, hpa@...or.com,
kjlu@....edu, platform-driver-x86@...r.kernel.org,
Ingo Molnar <mingo@...nel.org>, Sasha Levin <sashal@...nel.org>
Subject: [PATCH AUTOSEL 4.9 51/60] x86/platform/uv: Fix kmalloc() NULL check routine
From: Austin Kim <austindh.kim@...il.com>
[ Upstream commit 864b23f0169d5bff677e8443a7a90dfd6b090afc ]
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 <austindh.kim@...il.com>
Cc: Dimitri Sivanich <dimitri.sivanich@....com>
Cc: Hedi Berriche <hedi.berriche@....com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Mike Travis <mike.travis@....com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Russ Anderson <russ.anderson@....com>
Cc: Steve Wahl <steve.wahl@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: allison@...utok.net
Cc: andy@...radead.org
Cc: armijn@...ldur.nl
Cc: bp@...en8.de
Cc: dvhart@...radead.org
Cc: gregkh@...uxfoundation.org
Cc: hpa@...or.com
Cc: kjlu@....edu
Cc: platform-driver-x86@...r.kernel.org
Link: https://lkml.kernel.org/r/20190905232951.GA28779@LGEARND20B15
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
arch/x86/platform/uv/tlb_uv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index 16d4967d59ea2..814b01d4e519e 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -1816,9 +1816,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);
--
2.20.1
Powered by blists - more mailing lists