Skip to content

Commit

Permalink
class: Free the class private data in class_release
Browse files Browse the repository at this point in the history
Fix a memory leak by freeing the memory allocated in __class_register
for the class private data.

Signed-off-by: Laurent Pinchart <[email protected]>
Acked-by: Artem Bityutskiy <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
pinchartl authored and gregkh committed Feb 16, 2010
1 parent 7c0ff87 commit 18d19c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/base/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ static void class_release(struct kobject *kobj)
else
pr_debug("class '%s' does not have a release() function, "
"be careful\n", class->name);

kfree(cp);
}

static struct sysfs_ops class_sysfs_ops = {
Expand Down

0 comments on commit 18d19c9

Please sign in to comment.