Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115931
b: refs/heads/master
c: 2cdc724
h: refs/heads/master
i:
  115929: 5cec738
  115927: c7d217b
v: v3
  • Loading branch information
Li Zefan authored and Linus Torvalds committed Oct 20, 2008
1 parent 7493469 commit c45abdd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 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: 886465f407e57d6c3c81013c919ea670ce1ae0d0
refs/heads/master: 2cdc7241a290bb2b9ef4c2e2969a4a3ed92abb63
9 changes: 2 additions & 7 deletions trunk/security/device_cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,9 @@ static int dev_whitelist_copy(struct list_head *dest, struct list_head *orig)
struct dev_whitelist_item *wh, *tmp, *new;

list_for_each_entry(wh, orig, list) {
new = kmalloc(sizeof(*wh), GFP_KERNEL);
new = kmemdup(wh, sizeof(*wh), GFP_KERNEL);
if (!new)
goto free_and_exit;
new->major = wh->major;
new->minor = wh->minor;
new->type = wh->type;
new->access = wh->access;
list_add_tail(&new->list, dest);
}

Expand All @@ -114,11 +110,10 @@ static int dev_whitelist_add(struct dev_cgroup *dev_cgroup,
{
struct dev_whitelist_item *whcopy, *walk;

whcopy = kmalloc(sizeof(*whcopy), GFP_KERNEL);
whcopy = kmemdup(wh, sizeof(*wh), GFP_KERNEL);
if (!whcopy)
return -ENOMEM;

memcpy(whcopy, wh, sizeof(*whcopy));
spin_lock(&dev_cgroup->lock);
list_for_each_entry(walk, &dev_cgroup->whitelist, list) {
if (walk->type != wh->type)
Expand Down

0 comments on commit c45abdd

Please sign in to comment.