[ovs-dev] [PATCH 2/4] veth: Fix problems removing veth devices

Justin Pettit jpettit at nicira.com
Thu Apr 15 08:40:06 UTC 2010


On Apr 14, 2010, at 10:01 AM, Ben Pfaff wrote:

> On Wed, Apr 14, 2010 at 12:31:23AM -0700, Justin Pettit wrote:
>> When a user tried to delete a veth device through sysfs, the driver
>> wasn't properly parsing the device name.  Also, it called
>> dev_get_by_name(), which increments a refcount on the device, but didn't
>> make a dev_put() before trying to delete it.
> 
> (Boy, clearly I didn't ever test this code.)
> 
> But there's also a missing dev_put() in the -EINVAL path, right?  Since
> we already have the rtnl lock along that path I think we can just use
> __dev_get_by_name() and avoid the dev_put().


Ah, much nicer.  I went ahead and did it that way.  (The kernel module still has some issues with being rmmod'd, but I'm not overly concerned about getting them worked out at the moment, since this is so temporary.)

I'll push this out when I get the "patch" netdev type through the review process.

--Justin






More information about the dev mailing list