From: Ben Greear <greearb@candelatech.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [RFC] af-packet: Save reference to bound network device.
Date: Wed, 25 May 2011 15:36:55 -0700 [thread overview]
Message-ID: <4DDD8487.6070000@candelatech.com> (raw)
In-Reply-To: <20110525.181418.1100603684033986711.davem@davemloft.net>
On 05/25/2011 03:14 PM, David Miller wrote:
> From: Ben Greear<greearb@candelatech.com>
> Date: Wed, 25 May 2011 15:05:10 -0700
>
>> Doesn't this piece of code take care of that?
>> I tested with rmmod..but of course I could have missed something.
>>
>> @@ -2266,6 +2284,10 @@ static int packet_notifier(struct
>> notifier_block *this, unsigned long msg, void
>> }
>> if (msg == NETDEV_UNREGISTER) {
>> po->ifindex = -1;
>> + if (po->bound_dev) {
>> + dev_put(po->bound_dev);
>> + po->bound_dev = NULL;
>> + }
>> po->prot_hook.dev = NULL;
>> }
>> spin_unlock(&po->bind_lock);
>>
>
> Indeed, it should, thanks for pointing that out.
>
> Wait a second, why do you need to store the device a second
> time, can't you get at po->prot_hook.dev in all the necessary
> spots?
I can't see where the code holds any reference to prot_hook.dev.
(It just assigns the pointer and then does a dev_put()).
Maybe it gets away with it because a NETDEV_UNREGISTER event
is always sent?
Or, maybe we should hold a ref to it?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2011-05-25 22:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-25 21:56 [RFC] af-packet: Save reference to bound network device greearb
2011-05-25 22:01 ` David Miller
2011-05-25 22:05 ` Ben Greear
2011-05-25 22:14 ` David Miller
2011-05-25 22:22 ` Ben Greear
2011-05-25 22:36 ` Ben Greear [this message]
2011-05-25 22:42 ` David Miller
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=4DDD8487.6070000@candelatech.com \
--to=greearb@candelatech.com \
--cc=davem@davemloft.net \
--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 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.