Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2003146ybm; Thu, 23 May 2019 09:49:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqydHBUo1VDkzrVFBmTXBFvFHd5JRMP2pca0lS8HBwaVOvcaLwa0BU5GjH1c6vEOECQV/laa X-Received: by 2002:a63:c64a:: with SMTP id x10mr98126091pgg.195.1558630165993; Thu, 23 May 2019 09:49:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558630165; cv=none; d=google.com; s=arc-20160816; b=r5FP9hSXYygpOK+AG1a8uERQx/o70ea29hzZdhPl54w+Sa9qvDaU/18z4TqVtBdX+m rD00wnL0gdJHo68/ozJxMXyqVEwG4cffL6wkpVsJIaTWx0DO9YFHF9VQN6H6j4uFwAVb L1rifnrqAKnWjcouhl2EilkioI93WR9OpAUOmHwiPTHZiGjCPHHtU386kj2jP1QMMX+E Jt+IlK2ey9aO4GHiJ7dmiQupmWaQzDrZn115qtKAQbMoj96Tdhx0uZ5AYhlayNbra3ba 3mBn4viLJpcoLGxxO2FJyFgbM5g63WS2cwYhDV73RlZq1oZKwfnPprhhQQsQ5FzgpH6Z 38/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9BT48q8YZdsRfqqlq1WI5BEP04XlG5qRgRWBn7AKc74=; b=jF8zhZDsTKUMaO/wnwKHvv1n3Gj8sY+BbQ/jmeqLi42y+Njrf7+FZjx4x496bCJGlq y9X+t4Nkinfb+mm40zbNZ/dZmCc3cu8MAujxw1hl/M1G7gp603/h9tBXDUkHCFPjRrRM OaMgLDtuMMVQTNlZK3Ygy+G/hLOg10f1a5Oos3Rduhb9Cax2IvY8lInN3bPn8RgSSAz9 jr9B/+BuETWJKEFngYyGuDqG+gtGokqVrWfziISzAlJwvLnP9cUU9VzIMnpj5hRYKYE3 f4Tn0w3fJLDAQIzrrWtQZh25rrMxj9Y3ZPeqUWhTGrcyr91jNY60Pclhc6DEDaVjVA0U cJ0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=E49P5qe4; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si31349897pgh.594.2019.05.23.09.49.09; Thu, 23 May 2019 09:49:25 -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=@google.com header.s=20161025 header.b=E49P5qe4; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731153AbfEWQqy (ORCPT + 99 others); Thu, 23 May 2019 12:46:54 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:34205 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731042AbfEWQqx (ORCPT ); Thu, 23 May 2019 12:46:53 -0400 Received: by mail-ed1-f68.google.com with SMTP id p27so10175358eda.1 for ; Thu, 23 May 2019 09:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9BT48q8YZdsRfqqlq1WI5BEP04XlG5qRgRWBn7AKc74=; b=E49P5qe4m5z50mIcZEFehNywPQzUR2sTrsCDp7+OSPu94TJ5WPj6g4JT9ATXEEeN3i sVisvRi5Iane1ywRX7NtNSo3bNtGHc1/a+az/W4fDtuLbc87twSTs3T0FLCMzkd4h2Md gYqXEQpvkqs6D68Zg+Ty8k4Krc7l8H9ylcfFcgvPPCyCJIb/bxO7pV+eW4TIDQ1pP65F VBI41rxflmLGOaf9XKr3FvdLQzoT4CwXzRDXWwwCpwTv7K7RqP4KRnsI4SoPh/1+3M4A tb8wyvbpzyy2DMmmFuNtV7vOUBxU+FQSy2xfqaMS0VyejqGZ5NXkT2vhnC3uz5q07kaj eonw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9BT48q8YZdsRfqqlq1WI5BEP04XlG5qRgRWBn7AKc74=; b=ZImnOHXij2rcvDLqFPeebjftlS8zvL9ND9UNB1qqVgQfu4BcrOC8liqfEfTHhcUF07 5Nj2ankcy2DYYo3rvKY5uV61nLoxXJaxFH41B6U5NtJo9UsEZl14M2IWNqrxWx9PP01R YpQmkmX9S8Wwz54pOkl9pM5u/cm9XUmeD2g+Zs0w/z7AWp+O25OIOI0mWuOux5OAuhS3 VcnkVRr5UrBq1b8qvvjJTEk86j9D2suZsek3HDpbtrjU9FRZFnGFzrsfULbpI6DFSwIC 1UYvBRbGppcVxo2nhvKFiN8VZo5tpG2m+rKhr8WFtwPjiQsg2K89kmXrCGvD5Il6WuBN h3lg== X-Gm-Message-State: APjAAAW0SO7fiwSUym4RXvVFDdKG7+4xfOB/Sz/9A4jfXwsY5enPkksm DcPA4h10jSQrdDxS6IW4HNmLmvYqFrBYEAQz4yDU6g== X-Received: by 2002:a17:906:1f93:: with SMTP id t19mr28144676ejr.48.1558630010971; Thu, 23 May 2019 09:46:50 -0700 (PDT) MIME-Version: 1.0 References: <20190523161532.122421-1-natechancellor@gmail.com> In-Reply-To: <20190523161532.122421-1-natechancellor@gmail.com> From: Stephen Hines Date: Thu, 23 May 2019 09:46:38 -0700 Message-ID: Subject: Re: [PATCH] misc: sgi-xp: Properly initialize buf in xpc_get_rsvd_page_pa To: Nathan Chancellor Cc: Cliff Whickman , Robin Holt , Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Looks good to me. :) Since I don't contribute to the Linux kernel directly, I appreciate you picking this up. Thanks, Steve On Thu, May 23, 2019 at 9:20 AM Nathan Chancellor wrote: > > Clang warns: > > drivers/misc/sgi-xp/xpc_partition.c:73:14: warning: variable 'buf' is > uninitialized when used within its own initialization [-Wuninitialized] > void *buf = buf; > ~~~ ^~~ > 1 warning generated. > > Initialize it to NULL, which is more deterministic. > > Fixes: 279290294662 ("[IA64-SGI] cleanup the way XPC locates the reserved page") > Link: https://github.com/ClangBuiltLinux/linux/issues/466 > Suggested-by: Stephen Hines > Signed-off-by: Nathan Chancellor > --- > > Thanks Steve for the suggestion, don't know why that never crossed my > mind... > > I tried to follow buf all the way down in get_partition_rsvd_page to see > if there would be any dereferences and I didn't see any but I could > have easily missed something. > > drivers/misc/sgi-xp/xpc_partition.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c > index 3eba1c420cc0..782ce95d3f17 100644 > --- a/drivers/misc/sgi-xp/xpc_partition.c > +++ b/drivers/misc/sgi-xp/xpc_partition.c > @@ -70,7 +70,7 @@ xpc_get_rsvd_page_pa(int nasid) > unsigned long rp_pa = nasid; /* seed with nasid */ > size_t len = 0; > size_t buf_len = 0; > - void *buf = buf; > + void *buf = NULL; > void *buf_base = NULL; > enum xp_retval (*get_partition_rsvd_page_pa) > (void *, u64 *, unsigned long *, size_t *) = > -- > 2.22.0.rc1 >