All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS
@ 2020-01-13 13:06 Dan Carpenter
  2020-01-14  0:32 ` Martin Lau
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-01-13 13:06 UTC (permalink / raw)
  To: kernel-janitors

Hello Martin KaFai Lau,

The patch 85d33df357b6: "bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS" from
Jan 8, 2020, leads to the following static checker warning:

	kernel/bpf/bpf_struct_ops.c:501 bpf_struct_ops_map_seq_show_elem()
	warn: 'value' is an error pointer or valid

kernel/bpf/bpf_struct_ops.c
   495  static void bpf_struct_ops_map_seq_show_elem(struct bpf_map *map, void *key,
   496                                               struct seq_file *m)
   497  {
   498          void *value;
   499  
   500          value = bpf_struct_ops_map_lookup_elem(map, key);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is just a dummy function that only returns -EINVAL.

   501          if (!value)
   502                  return;
   503  
   504          btf_type_seq_show(btf_vmlinux, map->btf_vmlinux_value_type_id,
   505                            value, m);
   506          seq_puts(m, "\n");
   507  }


regards,
dan carpenter

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

* Re: [bug report] bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS
  2020-01-13 13:06 [bug report] bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS Dan Carpenter
@ 2020-01-14  0:32 ` Martin Lau
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Lau @ 2020-01-14  0:32 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Jan 13, 2020 at 04:06:17PM +0300, Dan Carpenter wrote:
> Hello Martin KaFai Lau,
> 
> The patch 85d33df357b6: "bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS" from
> Jan 8, 2020, leads to the following static checker warning:
> 
> 	kernel/bpf/bpf_struct_ops.c:501 bpf_struct_ops_map_seq_show_elem()
> 	warn: 'value' is an error pointer or valid
> 
> kernel/bpf/bpf_struct_ops.c
>    495  static void bpf_struct_ops_map_seq_show_elem(struct bpf_map *map, void *key,
>    496                                               struct seq_file *m)
>    497  {
>    498          void *value;
>    499  
>    500          value = bpf_struct_ops_map_lookup_elem(map, key);
>                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> This is just a dummy function that only returns -EINVAL.
Thanks for the report. I will post a fix.

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

end of thread, other threads:[~2020-01-14  0:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 13:06 [bug report] bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS Dan Carpenter
2020-01-14  0:32 ` Martin Lau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.