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

Ben Pfaff blp at nicira.com
Wed Apr 14 17:01:45 UTC 2010

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().

More information about the dev mailing list