From: Stephen Hines <srhines@google.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Cliff Whickman <cpw@sgi.com>, Robin Holt <robinmholt@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com,
Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH] misc: sgi-xp: Properly initialize buf in xpc_get_rsvd_page_pa
Date: Thu, 23 May 2019 09:46:38 -0700 [thread overview]
Message-ID: <CAAzmS6_ENnGayTm6fbbbk8dojXrKUEB1P2_ZtP914_GCOaVOoQ@mail.gmail.com> (raw)
In-Reply-To: <20190523161532.122421-1-natechancellor@gmail.com>
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
<natechancellor@gmail.com> 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 <srhines@google.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>
> 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
>
next prev parent reply other threads:[~2019-05-23 16:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 3:33 -Wuninitialized warning in drivers/misc/sgi-xp/xpc_partition.c Nathan Chancellor
2019-05-23 1:56 ` Nathan Chancellor
2019-05-23 5:52 ` Greg Kroah-Hartman
2019-05-23 6:58 ` Stephen Hines
2019-05-23 16:15 ` [PATCH] misc: sgi-xp: Properly initialize buf in xpc_get_rsvd_page_pa Nathan Chancellor
2019-05-23 16:46 ` Stephen Hines [this message]
2019-05-23 18:05 ` Nick Desaulniers
2019-05-24 7:40 ` Arnd Bergmann
2019-05-24 16:00 ` Greg Kroah-Hartman
2019-05-24 16:15 ` Nathan Chancellor
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=CAAzmS6_ENnGayTm6fbbbk8dojXrKUEB1P2_ZtP914_GCOaVOoQ@mail.gmail.com \
--to=srhines@google.com \
--cc=arnd@arndb.de \
--cc=clang-built-linux@googlegroups.com \
--cc=cpw@sgi.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=robinmholt@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).