Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330147
b: refs/heads/master
c: 868539a
h: refs/heads/master
i:
  330145: 135125f
  330143: 9a86118
v: v3
  • Loading branch information
Aristeu Rozanski authored and Linus Torvalds committed Oct 5, 2012
1 parent 323eb58 commit ec5291c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 66b8ef67756b3051bf42a077a82c3c5c279caa5b
refs/heads/master: 868539a3b671e0f736ddd11b67bf1dc3d8a5a921
22 changes: 17 additions & 5 deletions trunk/security/device_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,22 @@ static void dev_whitelist_rm(struct dev_cgroup *dev_cgroup,
}
}

/**
* dev_whitelist_clean - frees all entries of the whitelist
* @dev_cgroup: dev_cgroup with the whitelist to be cleaned
*
* called under devcgroup_mutex
*/
static void dev_whitelist_clean(struct dev_cgroup *dev_cgroup)
{
struct dev_whitelist_item *wh, *tmp;

list_for_each_entry_safe(wh, tmp, &dev_cgroup->whitelist, list) {
list_del(&wh->list);
kfree(wh);
}
}

/*
* called from kernel/cgroup.c with cgroup_lock() held.
*/
Expand Down Expand Up @@ -200,13 +216,9 @@ static struct cgroup_subsys_state *devcgroup_create(struct cgroup *cgroup)
static void devcgroup_destroy(struct cgroup *cgroup)
{
struct dev_cgroup *dev_cgroup;
struct dev_whitelist_item *wh, *tmp;

dev_cgroup = cgroup_to_devcgroup(cgroup);
list_for_each_entry_safe(wh, tmp, &dev_cgroup->whitelist, list) {
list_del(&wh->list);
kfree(wh);
}
dev_whitelist_clean(dev_cgroup);
kfree(dev_cgroup);
}

Expand Down

0 comments on commit ec5291c

Please sign in to comment.