lkml.org 
[lkml]   [2017]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/4] staging: ccree: Remove a attribute group from a kobject
Date
All attribute group created during sys_init_dir() should be removed
in sys_free_dir()

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/staging/ccree/ssi_sysfs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ccree/ssi_sysfs.c b/drivers/staging/ccree/ssi_sysfs.c
index 5d39f15..14a3f32 100644
--- a/drivers/staging/ccree/ssi_sysfs.c
+++ b/drivers/staging/ccree/ssi_sysfs.c
@@ -145,8 +145,11 @@ static void sys_free_dir(struct sys_dir *sys_dir)

kfree(sys_dir->sys_dir_attr_list);

- if (sys_dir->sys_dir_kobj)
+ if (sys_dir->sys_dir_kobj) {
+ sysfs_remove_group(sys_dir->sys_dir_kobj,
+ &sys_dir->sys_dir_attr_group);
kobject_put(sys_dir->sys_dir_kobj);
+ }
}

int ssi_sysfs_init(struct kobject *sys_dev_obj, struct ssi_drvdata *drvdata)
--
2.7.4
\
 
 \ /
  Last update: 2017-11-25 07:41    [W:0.048 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site