netdev
[Top] [All Lists]

Re: Question on net_device->refcnt && unregister_netdevice.

To: greearb@xxxxxxxxxxxxxxx (Ben Greear)
Subject: Re: Question on net_device->refcnt && unregister_netdevice.
From: kuznet@xxxxxxxxxxxxx
Date: Sun, 13 Feb 2000 21:58:20 +0300 (MSK)
Cc: netdev@xxxxxxxxxxx
In-reply-to: <38A7021B.B8EF42AF@candelatech.com> from "Ben Greear" at Feb 13, 0 12:12:28 pm
Sender: owner-netdev@xxxxxxxxxxx
Hello!

> I think I found most of them.  The problem was that I found devices
> by their name quite often:  dev_get_by_name(), and never explicitly
> released them.

OK! Actually, it you make this from dev->ioctl, dev->open
or dev->close and do not save pointer to device, you may use
__dev_get_by_*(), it does not increase refcnt. (device list
is not protected by semaphore, while you sit in these routines).

> Does this also cause problems in the 2.2 kernels?

No. 2.2 did not have refcnt. The problem really existed,
but it was masked, because probability of reference to already
killed device is very low. In 2.3 it is real problem, because
accounting itself needs reference to dead memory area.

Alexey

<Prev in Thread] Current Thread [Next in Thread>