public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bpf: Initialize ret to 0 inside btf_populate_kfunc_set()
@ 2022-02-19 16:39 Souptick Joarder
  2022-02-20  0:42 ` Kumar Kartikeya Dwivedi
  2022-02-20  1:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Souptick Joarder @ 2022-02-19 16:39 UTC (permalink / raw)
  To: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
	kpsingh, memxor
  Cc: netdev, bpf, linux-kernel, Souptick Joarder (HPE),
	kernel test robot

From: "Souptick Joarder (HPE)" <jrdr.linux@gmail.com>

Kernel test robot reported below error ->

kernel/bpf/btf.c:6718 btf_populate_kfunc_set()
error: uninitialized symbol 'ret'.

Initialize ret to 0.

Fixes: 	dee872e124e8 ("bpf: Populate kfunc BTF ID sets in struct btf")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
---
 kernel/bpf/btf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 02d7014417a0..2c4c5dbe2abe 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -6706,7 +6706,7 @@ static int btf_populate_kfunc_set(struct btf *btf, enum btf_kfunc_hook hook,
 				  const struct btf_kfunc_id_set *kset)
 {
 	bool vmlinux_set = !btf_is_module(btf);
-	int type, ret;
+	int type, ret = 0;
 
 	for (type = 0; type < ARRAY_SIZE(kset->sets); type++) {
 		if (!kset->sets[type])
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] bpf: Initialize ret to 0 inside btf_populate_kfunc_set()
  2022-02-19 16:39 [PATCH] bpf: Initialize ret to 0 inside btf_populate_kfunc_set() Souptick Joarder
@ 2022-02-20  0:42 ` Kumar Kartikeya Dwivedi
  2022-02-20  1:39   ` Alexei Starovoitov
  2022-02-20  1:40 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Kumar Kartikeya Dwivedi @ 2022-02-20  0:42 UTC (permalink / raw)
  To: Souptick Joarder
  Cc: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
	kpsingh, netdev, bpf, linux-kernel, kernel test robot

On Sat, Feb 19, 2022 at 10:09:15PM IST, Souptick Joarder wrote:
> From: "Souptick Joarder (HPE)" <jrdr.linux@gmail.com>
>
> Kernel test robot reported below error ->
>
> kernel/bpf/btf.c:6718 btf_populate_kfunc_set()
> error: uninitialized symbol 'ret'.
>
> Initialize ret to 0.
>
> Fixes: 	dee872e124e8 ("bpf: Populate kfunc BTF ID sets in struct btf")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
> ---

Thanks for the fix.

Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>

>  kernel/bpf/btf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 02d7014417a0..2c4c5dbe2abe 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -6706,7 +6706,7 @@ static int btf_populate_kfunc_set(struct btf *btf, enum btf_kfunc_hook hook,
>  				  const struct btf_kfunc_id_set *kset)
>  {
>  	bool vmlinux_set = !btf_is_module(btf);
> -	int type, ret;
> +	int type, ret = 0;
>
>  	for (type = 0; type < ARRAY_SIZE(kset->sets); type++) {
>  		if (!kset->sets[type])
> --
> 2.25.1
>

--
Kartikeya

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] bpf: Initialize ret to 0 inside btf_populate_kfunc_set()
  2022-02-20  0:42 ` Kumar Kartikeya Dwivedi
@ 2022-02-20  1:39   ` Alexei Starovoitov
  0 siblings, 0 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2022-02-20  1:39 UTC (permalink / raw)
  To: Kumar Kartikeya Dwivedi
  Cc: Souptick Joarder, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Network Development, bpf, LKML,
	kernel test robot

On Sat, Feb 19, 2022 at 4:42 PM Kumar Kartikeya Dwivedi
<memxor@gmail.com> wrote:
>
> On Sat, Feb 19, 2022 at 10:09:15PM IST, Souptick Joarder wrote:
> > From: "Souptick Joarder (HPE)" <jrdr.linux@gmail.com>
> >
> > Kernel test robot reported below error ->
> >
> > kernel/bpf/btf.c:6718 btf_populate_kfunc_set()
> > error: uninitialized symbol 'ret'.
> >
> > Initialize ret to 0.
> >
> > Fixes:        dee872e124e8 ("bpf: Populate kfunc BTF ID sets in struct btf")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
> > ---
>
> Thanks for the fix.
>
> Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>

Applied to bpf-next, since the bug will not trigger in practice.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] bpf: Initialize ret to 0 inside btf_populate_kfunc_set()
  2022-02-19 16:39 [PATCH] bpf: Initialize ret to 0 inside btf_populate_kfunc_set() Souptick Joarder
  2022-02-20  0:42 ` Kumar Kartikeya Dwivedi
@ 2022-02-20  1:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-02-20  1:40 UTC (permalink / raw)
  To: Souptick Joarder
  Cc: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
	kpsingh, memxor, netdev, bpf, linux-kernel, lkp

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Sat, 19 Feb 2022 22:09:15 +0530 you wrote:
> From: "Souptick Joarder (HPE)" <jrdr.linux@gmail.com>
> 
> Kernel test robot reported below error ->
> 
> kernel/bpf/btf.c:6718 btf_populate_kfunc_set()
> error: uninitialized symbol 'ret'.
> 
> [...]

Here is the summary with links:
  - bpf: Initialize ret to 0 inside btf_populate_kfunc_set()
    https://git.kernel.org/bpf/bpf-next/c/d0b3822902b6

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-20  1:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-19 16:39 [PATCH] bpf: Initialize ret to 0 inside btf_populate_kfunc_set() Souptick Joarder
2022-02-20  0:42 ` Kumar Kartikeya Dwivedi
2022-02-20  1:39   ` Alexei Starovoitov
2022-02-20  1:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox