Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp781538ybn; Tue, 24 Sep 2019 09:23:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyz7CmefDdrRZ729ZsXANBco4l3Z394AialxCu7C8GYxS/rpHcE6qdFo4L/qkKNQ2hFveCD X-Received: by 2002:a17:906:90c1:: with SMTP id v1mr3171637ejw.259.1569342220005; Tue, 24 Sep 2019 09:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569342219; cv=none; d=google.com; s=arc-20160816; b=E4kGkhBywL8GTZ7jE9DohgD8mzqCl8u1QDNlCHtSni5r1dmpSXY7p+GDdVGeIwtPvx XR+Rq9hnecR5Y9wa9syAoClCRl0Llz0l+YWlappGcpD1Igt142PziHjx04QsqHbSQckd D0Q7H2hB9mSAZPTdFBabJ9ieLa3iZVW0mrIHTLSlqy9DrBe14odtAtGDM03PFCcdtAzZ fTCmMSQQnlxDUcNoMNdiZBZuIdh+791QLUY9D/q7y1y3rvYzlgaZUneJ9Ms3puNJnUlB JDPtIE3rg7RfNFpuww/xs5XyUVNA4Su315B4MImD/R6FciG6RSLZtO5Wf0+UIMjA9ZiQ gQnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VDv89Ulc1WFWjUOk2JjuSluPw6JLLy8koXDjlV29bj0=; b=fYT5+tUucRHH7Onj1sRHj5MaCQXqm8q+XbW/Yhd302LKnLmgXYG9MvxJSa0mH+oLJo 0g6k1khq+fwWeXfKO+jqwZa2YNimbS08SYoa5lWHYuCbV56F35wff7iIGfKGAgALablk SEZokcsvi+0NYISyBuL1OW5rc1YW7vBp8+HmgVgyoVzWIvHQjNU0K2JfaS3a4FG+dVz+ NR+2k+NhvOo/9yYBC1qjrcEUGuMXYtauLyDhVpb/uD6pQ3zKE6h842VmeFjtBfW7EK4S 9mJuwMUeV/v1duTJH/zUTeKqWrL5lhyoTNHl7u5o2OjaYEJIVeHTZVjhPqyIBKEgDNO0 7ROA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ibZz2JCL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si1070761ejp.326.2019.09.24.09.23.15; Tue, 24 Sep 2019 09:23:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ibZz2JCL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731865AbfIVUZ4 (ORCPT + 99 others); Sun, 22 Sep 2019 16:25:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:55332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726188AbfIVUZz (ORCPT ); Sun, 22 Sep 2019 16:25:55 -0400 Received: from localhost (unknown [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3FC8D20644; Sun, 22 Sep 2019 20:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569183954; bh=lnqz5lNN8HlaQXC31DrIw2TCWk6wgsRyvy3CZVgtWTc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ibZz2JCL3uR8hlgXpw/VtXngL3ZrNRKUQ/xD+kGXti6yM7K8SIqoKHZLUniGtRqx9 FSJ8FFs6FHIdmAkeiPSbOVm22um6wDn5KwDLSfXqcSWOBTJLUtclqjkTYNAAjzosSC 4gB9gziS74ERqlQ6GxTg8vjqFoXQyymEDLrCxUJM= Date: Sun, 22 Sep 2019 22:25:44 +0200 From: Greg KH To: Sasha Levin Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Austin Kim , Dimitri Sivanich , Hedi Berriche , Linus Torvalds , Mike Travis , Peter Zijlstra , Russ Anderson , Steve Wahl , Thomas Gleixner , 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 Subject: Re: [PATCH AUTOSEL 5.3 169/203] x86/platform/uv: Fix kmalloc() NULL check routine Message-ID: <20190922202544.GA2719513@kroah.com> References: <20190922184350.30563-1-sashal@kernel.org> <20190922184350.30563-169-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190922184350.30563-169-sashal@kernel.org> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 22, 2019 at 02:43:15PM -0400, Sasha Levin wrote: > From: Austin Kim > > [ 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 > Cc: Dimitri Sivanich > Cc: Hedi Berriche > Cc: Linus Torvalds > Cc: Mike Travis > Cc: Peter Zijlstra > Cc: Russ Anderson > Cc: Steve Wahl > Cc: Thomas Gleixner > 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 > Signed-off-by: Sasha Levin > --- > 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