Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1507688

Re: [PATCH] can: fix warning in bcm_connect/proc_register

From Cong Wang <xiyou.wangcong@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] can: fix warning in bcm_connect/proc_register
Date 2016-10-24 22:20 +0200
Message-ID <svTSV-43c-3@gated-at.bofh.it> (permalink)
References <svSWR-3rd-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Oct 24, 2016 at 12:11 PM, Oliver Hartkopp
<socketcan@hartkopp.net> wrote:
>         if (proc_dir) {
>                 /* unique socket address as filename */
>                 sprintf(bo->procname, "%lu", sock_i_ino(sk));
>                 bo->bcm_proc_read = proc_create_data(bo->procname, 0644,
>                                                      proc_dir,
>                                                      &bcm_proc_fops, sk);
> +               if (!bo->bcm_proc_read) {
> +                       ret = -ENOMEM;
> +                       goto fail;
> +               }

Well, I meant we need to call proc_create_data() once per socket,
so we need a check before proc_create_data() too.

Thanks.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] can: fix warning in bcm_connect/proc_register Oliver Hartkopp <socketcan@hartkopp.net> - 2016-10-24 21:20 +0200
  Re: [PATCH] can: fix warning in bcm_connect/proc_register Cong Wang <xiyou.wangcong@gmail.com> - 2016-10-24 22:20 +0200
    Re: [PATCH] can: fix warning in bcm_connect/proc_register Andrey Konovalov <andreyknvl@google.com> - 2016-10-25 14:20 +0200
  Re: [PATCH] can: fix warning in bcm_connect/proc_register Cong Wang <xiyou.wangcong@gmail.com> - 2016-10-24 22:20 +0200

csiph-web