From 4d697aa315701e238e93e77947ac7ee61f10c578 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Thu, 9 Jan 2020 18:02:22 -0500 Subject: [PATCH] Don't leak ksets --- include/linux/kobject.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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))