Skip to content

Commit

Permalink
staging: ccree: Remove a attribute group from a kobject
Browse files Browse the repository at this point in the history
All attribute group created during sys_init_dir() should be removed
in sys_free_dir()

Signed-off-by: Arvind Yadav <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ArvindYadavCs authored and gregkh committed Nov 28, 2017
1 parent a5eb218 commit 8b07512
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/staging/ccree/ssi_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,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)
Expand Down

0 comments on commit 8b07512

Please sign in to comment.