Commit 8570cd0b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] Driver core: Fix class leak in class_hotplug.

Thanks to Pat Mochel for pointing this out to me.
parent de21edae
......@@ -149,6 +149,7 @@ int dev_hotplug (struct device *dev, const char *action)
int class_hotplug (struct device *dev, const char *action)
{
struct device_class * cls;
int retval;
pr_debug ("%s\n", __FUNCTION__);
......@@ -162,5 +163,9 @@ int class_hotplug (struct device *dev, const char *action)
if (!cls)
return -ENODEV;
return do_hotplug (dev, cls->name, action, cls->hotplug);
retval = do_hotplug (dev, cls->name, action, cls->hotplug);
put_devclass(cls);
return retval;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment