* [PATCH] percpu: fix pcpu_page_first_chunk return code handling
@ 2019-07-08 12:52 Arnd Bergmann
2019-07-08 14:50 ` Dennis Zhou
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2019-07-08 12:52 UTC (permalink / raw)
To: Dennis Zhou, Tejun Heo, Christoph Lameter
Cc: Arnd Bergmann, Kefeng Wang, Peng Fan, Andrew Morton,
Mike Rapoport, Greg Kroah-Hartman, Dennis Zhou (Facebook),
linux-mm, linux-kernel
gcc complains that pcpu_page_first_chunk() might return an uninitialized
error code when the loop is never entered:
mm/percpu.c: In function 'pcpu_page_first_chunk':
mm/percpu.c:2929:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Make it return zero like before the cleanup.
Fixes: a13e0ad81216 ("percpu: Make pcpu_setup_first_chunk() void function")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
mm/percpu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/percpu.c b/mm/percpu.c
index 5a918a4b1da0..5b65f753c575 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -2917,6 +2917,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size,
ai->reserved_size, ai->dyn_size);
pcpu_setup_first_chunk(ai, vm.addr);
+ rc = 0;
goto out_free_ar;
enomem:
--
2.20.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] percpu: fix pcpu_page_first_chunk return code handling
2019-07-08 12:52 [PATCH] percpu: fix pcpu_page_first_chunk return code handling Arnd Bergmann
@ 2019-07-08 14:50 ` Dennis Zhou
0 siblings, 0 replies; 2+ messages in thread
From: Dennis Zhou @ 2019-07-08 14:50 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Dennis Zhou, Tejun Heo, Christoph Lameter, Kefeng Wang, Peng Fan,
Andrew Morton, Mike Rapoport, Greg Kroah-Hartman,
Dennis Zhou (Facebook),
linux-mm, linux-kernel
On Mon, Jul 08, 2019 at 02:52:09PM +0200, Arnd Bergmann wrote:
> gcc complains that pcpu_page_first_chunk() might return an uninitialized
> error code when the loop is never entered:
>
> mm/percpu.c: In function 'pcpu_page_first_chunk':
> mm/percpu.c:2929:9: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> Make it return zero like before the cleanup.
>
> Fixes: a13e0ad81216 ("percpu: Make pcpu_setup_first_chunk() void function")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> mm/percpu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mm/percpu.c b/mm/percpu.c
> index 5a918a4b1da0..5b65f753c575 100644
> --- a/mm/percpu.c
> +++ b/mm/percpu.c
> @@ -2917,6 +2917,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size,
> ai->reserved_size, ai->dyn_size);
>
> pcpu_setup_first_chunk(ai, vm.addr);
> + rc = 0;
> goto out_free_ar;
>
> enomem:
> --
> 2.20.0
>
Hi Arnd,
I got the report for the kbuild bot. I have the fix in my tree already.
Thanks,
Dennis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-08 14:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 12:52 [PATCH] percpu: fix pcpu_page_first_chunk return code handling Arnd Bergmann
2019-07-08 14:50 ` Dennis Zhou
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).