[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4DDD8487.6070000@candelatech.com>
Date: Wed, 25 May 2011 15:36:55 -0700
From: Ben Greear <greearb@...delatech.com>
To: David Miller <davem@...emloft.net>
CC: netdev@...r.kernel.org
Subject: Re: [RFC] af-packet: Save reference to bound network device.
On 05/25/2011 03:14 PM, David Miller wrote:
> From: Ben Greear<greearb@...delatech.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@...delatech.com>
Candela Technologies Inc http://www.candelatech.com
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists