netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gao feng <gaofeng@cn.fujitsu.com>
To: Flavio Leitner <fbl@redhat.com>
Cc: Wanlong Gao <gaowanlong@cn.fujitsu.com>,
	netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH] netconsole: enable netconsole can make net_device refcnt
Date: Wed, 12 Oct 2011 09:45:55 +0800	[thread overview]
Message-ID: <4E94F153.2070105@cn.fujitsu.com> (raw)
In-Reply-To: <20111011221148.2ef4487d@asterix.rh>

12.10.2011 09:11, Flavio Leitner wrote:
> On Tue, 11 Oct 2011 16:05:48 +0800
> Gao feng <gaofeng@cn.fujitsu.com> wrote:
> 
>> Im so sorry.
>> the first patch has some format err.
>> Please use this one.
>> thanks wanlong! ^V^
>>
>> 11.10.2011 15:50, Wanlong Gao wrote:
>>> There is no check if netconsole is enabled current.
>>> so when exec echo 1 > enabled;
>>> the reference of net_device will increment always.
>>>
>>> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
>>> ---
>>>  drivers/net/netconsole.c |    2 ++
>>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
>>> index ed2a397..4e6323df 100644
>>> --- a/drivers/net/netconsole.c
>>> +++ b/drivers/net/netconsole.c
>>> @@ -307,6 +307,8 @@ static ssize_t store_enabled(struct
>>> netconsole_target *nt, return err;
>>>  	if (enabled < 0 || enabled > 1)
>>>  		return -EINVAL;
>>> +	if (enabled == nt->enabled)
>>> +		return err;
> 
> It looks like 'err' will be 0.  Maybe it is better to
> return -EINVAL?
> 
> fbl
> 

Yes,you are right,and I will add some printk.thanks.

      reply	other threads:[~2011-10-12  1:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-11  6:29 [PATCH] netconsole: enable netconsole can make net_device refcnt incorrent Gao feng
2011-10-11  7:50 ` [PATCH] netconsole: enable netconsole can make net_device refcnt Wanlong Gao
2011-10-11  8:05   ` Gao feng
2011-10-12  1:11     ` Flavio Leitner
2011-10-12  1:45       ` Gao feng [this message]

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=4E94F153.2070105@cn.fujitsu.com \
    --to=gaofeng@cn.fujitsu.com \
    --cc=davem@davemloft.net \
    --cc=fbl@redhat.com \
    --cc=gaowanlong@cn.fujitsu.com \
    --cc=netdev@vger.kernel.org \
    /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).