linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Andrey Konovalov <andreyknvl@google.com>,
	David Miller <davem@davemloft.net>,
	linux-can@vger.kernel.org,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	syzkaller <syzkaller@googlegroups.com>,
	Kostya Serebryany <kcc@google.com>,
	Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH] can: fix warning in bcm_connect/proc_register
Date: Mon, 24 Oct 2016 13:17:19 -0700	[thread overview]
Message-ID: <CAM_iQpVmhH_9vQcTw+wP1qmPLOijZZrMZrq=_e4i5fUXYDON0Q@mail.gmail.com> (raw)
In-Reply-To: <CAM_iQpXj3ktALCmjwaPKJuf0SDEc6Txk-yYkRzZ79LFEsxOx3w@mail.gmail.com>

On Mon, Oct 24, 2016 at 1:10 PM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> 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.

Hmm, bo->bound should guarantee it, so never mind, your patch
looks fine.

  reply	other threads:[~2016-10-24 20:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 19:11 [PATCH] can: fix warning in bcm_connect/proc_register Oliver Hartkopp
2016-10-24 20:10 ` Cong Wang
2016-10-24 20:17   ` Cong Wang [this message]
2016-10-25 12:12     ` Andrey Konovalov
2016-10-27  8:45     ` Marc Kleine-Budde
2016-10-27 16:28       ` Cong Wang
2016-10-28  8:58         ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAM_iQpVmhH_9vQcTw+wP1qmPLOijZZrMZrq=_e4i5fUXYDON0Q@mail.gmail.com' \
    --to=xiyou.wangcong@gmail.com \
    --cc=andreyknvl@google.com \
    --cc=davem@davemloft.net \
    --cc=dvyukov@google.com \
    --cc=edumazet@google.com \
    --cc=glider@google.com \
    --cc=kcc@google.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    --cc=syzkaller@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).