lkml.org 
[lkml]   [2020]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/1] net: Fix use of proc_fs
On Fri, Dec 11, 2020 at 5:37 PM Yonatan Linik <yonatanlinik@gmail.com> wrote:

> index 2b33e977a905..031f2b593720 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -4612,9 +4612,11 @@ static int __net_init packet_net_init(struct net *net)
> mutex_init(&net->packet.sklist_lock);
> INIT_HLIST_HEAD(&net->packet.sklist);
>
> +#ifdef CONFIG_PROC_FS
> if (!proc_create_net("packet", 0, net->proc_net, &packet_seq_ops,
> sizeof(struct seq_net_private)))
> return -ENOMEM;
> +#endif /* CONFIG_PROC_FS */
>

Another option would be to just ignore the return code here
and continue without a procfs file, regardless of whether procfs
is enabled or not.

Arnd

\
 
 \ /
  Last update: 2020-12-11 22:04    [W:0.200 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site