summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/module.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 8c25b1a04fa6..1ecf08106381 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2425,6 +2425,12 @@ void module_remove_driver(struct device_driver *drv)
kfree(driver_name);
}
}
+ /*
+ * Undo the additional reference we added in module_add_driver()
+ * via kset_find_obj()
+ */
+ if (drv->mod_name)
+ kobject_put(&drv->kobj);
}
EXPORT_SYMBOL(module_remove_driver);
#endif