From: Greg KH <gregkh@linuxfoundation.org>
To: Sasha Levin <sashal@kernel.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Austin Kim <austindh.kim@gmail.com>,
Dimitri Sivanich <dimitri.sivanich@hpe.com>,
Hedi Berriche <hedi.berriche@hpe.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Mike Travis <mike.travis@hpe.com>,
Peter Zijlstra <peterz@infradead.org>,
Russ Anderson <russ.anderson@hpe.com>,
Steve Wahl <steve.wahl@hpe.com>,
Thomas Gleixner <tglx@linutronix.de>,
allison@lohutok.net, andy@infradead.org, armijn@tjaldur.nl,
bp@alien8.de, dvhart@infradead.org, hpa@zytor.com, kjlu@umn.edu,
platform-driver-x86@vger.kernel.org,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH AUTOSEL 5.3 169/203] x86/platform/uv: Fix kmalloc() NULL check routine
Date: Sun, 22 Sep 2019 22:25:44 +0200 [thread overview]
Message-ID: <20190922202544.GA2719513@kroah.com> (raw)
In-Reply-To: <20190922184350.30563-169-sashal@kernel.org>
On Sun, Sep 22, 2019 at 02:43:15PM -0400, Sasha Levin wrote:
> From: Austin Kim <austindh.kim@gmail.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@gmail.com>
> Cc: Dimitri Sivanich <dimitri.sivanich@hpe.com>
> Cc: Hedi Berriche <hedi.berriche@hpe.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Mike Travis <mike.travis@hpe.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Russ Anderson <russ.anderson@hpe.com>
> Cc: Steve Wahl <steve.wahl@hpe.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: allison@lohutok.net
> Cc: andy@infradead.org
> Cc: armijn@tjaldur.nl
> Cc: bp@alien8.de
> Cc: dvhart@infradead.org
> Cc: gregkh@linuxfoundation.org
> Cc: hpa@zytor.com
> Cc: kjlu@umn.edu
> Cc: platform-driver-x86@vger.kernel.org
> Link: https://lkml.kernel.org/r/20190905232951.GA28779@LGEARND20B15
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Sasha Levin <sashal@kernel.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 20c389a91b803..5f0a96bf27a1f 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);
>
How did this even get merged in the first place? I thought a number of
us complained about it.
This isn't any change in code, and the original is just fine, the author
didn't realize how C works :(
Please drop this.
thanks,
greg k-h
next prev parent reply other threads:[~2019-09-22 20:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190922184350.30563-1-sashal@kernel.org>
2019-09-22 18:43 ` [PATCH AUTOSEL 5.3 169/203] x86/platform/uv: Fix kmalloc() NULL check routine Sasha Levin
2019-09-22 20:25 ` Greg KH [this message]
2019-10-01 16:06 ` Sasha Levin
2019-10-02 8:34 ` David Laight
2019-10-02 14:35 ` Mike Travis
2019-09-22 18:43 ` [PATCH AUTOSEL 5.3 171/203] platform/x86: intel_pmc_core: Do not ioremap RAM Sasha Levin
2019-09-22 18:43 ` [PATCH AUTOSEL 5.3 172/203] platform/x86: intel_pmc_core_pltdrv: Module removal warning fix Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190922202544.GA2719513@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=allison@lohutok.net \
--cc=andy@infradead.org \
--cc=armijn@tjaldur.nl \
--cc=austindh.kim@gmail.com \
--cc=bp@alien8.de \
--cc=dimitri.sivanich@hpe.com \
--cc=dvhart@infradead.org \
--cc=hedi.berriche@hpe.com \
--cc=hpa@zytor.com \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.travis@hpe.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=russ.anderson@hpe.com \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=steve.wahl@hpe.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox