summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2002-12-11 17:38:05 -0800
committerGreg Kroah-Hartman <greg@kroah.com>2002-12-11 17:38:05 -0800
commit8570cd0b76293c813bd6abca06d4cab846ca2c34 (patch)
tree8772cf96f6699cfa776d7138f9fcac193a3e5cdb /drivers/base
parentde21edaef4f6d64f8bf14cd196e0ab6cfb4e8559 (diff)
[PATCH] Driver core: Fix class leak in class_hotplug.
Thanks to Pat Mochel for pointing this out to me.
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/hotplug.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/base/hotplug.c b/drivers/base/hotplug.c
index 95937fbe3676..6c66892b23cb 100644
--- a/drivers/base/hotplug.c
+++ b/drivers/base/hotplug.c
@@ -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;
}