Skip to contentSkip to conversation

: Do not free already unregistered net device.

PATCH Don Fry 3 participants 4 messages May 5, 2008 – May 6, 2008

Subsystems (2)
lore
Share & tools
lore

Don Fry

author
#0 lore raw

I do not understand why this change was accepted. All of the network drivers I just looked at in 2.6.25 do unregister_netdev() followed sometime soon by free_netdev(). Is there something different about ATM devices? I did not look at all the drivers.

Don

maintainer
#1 lore raw

From: Don Fry <[email protected]>
Date: Mon, 05 May 2008 09:44:40 -0700

Quoted 4 lines

I do not understand why this change was accepted. All of the network drivers I just looked at in 2.6.25 do unregister_netdev() followed sometime soon by free_netdev(). Is there something different about ATM devices? I did not look at all the drivers.

Indeed, this change does look bogus.

Pavel, please take a look, unregister_netdev() indeed does not free the netdevice, and something (usually the caller) needs to do it.

I think I should revert your change.

#2 lore raw
Quoted 8 lines · David Miller

From: Don Fry <[email protected]>
Date: Mon, 05 May 2008 09:44:40 -0700

Quoted 4 lines

I do not understand why this change was accepted. All of the network drivers I just looked at in 2.6.25 do unregister_netdev() followed sometime soon by free_netdev(). Is there something different about ATM devices? I did not look at all the drivers.

Quoted 4 lines

Indeed, this change does look bogus.

Pavel, please take a look, unregister_netdev() indeed does not free the netdevice, and something (usually the caller) needs to do it.

Indeed :( My bad, I've overlooked the fact, that this device doesn't have a ->destructor callback set (which most of the others set to the free_netdev), so the free_netdev is to be called manually.

Quoted 1 line

I think I should revert your change.

Agree. Sorry, for the confusion.

maintainer
#3 lore raw

From: Pavel Emelyanov <[email protected]>
Date: Tue, 06 May 2008 10:34:38 +0400

Quoted 4 lines
Quoted 1 line · David Miller

I think I should revert your change.

Agree. Sorry, for the confusion.

No worries, thanks for confirming. I'll revert the change right now.