summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-01-09 18:02:22 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2020-01-09 18:02:22 -0500
commit4d697aa315701e238e93e77947ac7ee61f10c578 (patch)
tree910c5050c4b07301b274b06043591b8e10d41190
parentab2f1ec24f5307b0cf1e3c4ad19bf350d9f54d9f (diff)
Don't leak ksets
-rw-r--r--include/linux/kobject.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index bba5c638..d5241786 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -121,7 +121,10 @@ static inline struct kobject *kobject_get(struct kobject *kobj)
return kobj;
}
-static inline void kset_unregister(struct kset *kset) {}
+static inline void kset_unregister(struct kset *kset)
+{
+ kfree(kset);
+}
#define kset_create_and_add(_name, _u, _parent) \
((struct kset *) kzalloc(sizeof(struct kset), GFP_KERNEL))