diff options
-rw-r--r-- | security/device_cgroup.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 15f2f8003ba3..f9941a769738 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
@@ -506,7 +506,6 @@ struct cgroup_subsys devices_subsys = { | |||
506 | 506 | ||
507 | int devcgroup_inode_permission(struct inode *inode, int mask) | 507 | int devcgroup_inode_permission(struct inode *inode, int mask) |
508 | { | 508 | { |
509 | struct cgroup *cgroup; | ||
510 | struct dev_cgroup *dev_cgroup; | 509 | struct dev_cgroup *dev_cgroup; |
511 | struct dev_whitelist_item *wh; | 510 | struct dev_whitelist_item *wh; |
512 | 511 | ||
@@ -515,8 +514,8 @@ int devcgroup_inode_permission(struct inode *inode, int mask) | |||
515 | return 0; | 514 | return 0; |
516 | if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode)) | 515 | if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode)) |
517 | return 0; | 516 | return 0; |
518 | cgroup = task_cgroup(current, devices_subsys.subsys_id); | 517 | dev_cgroup = css_to_devcgroup(task_subsys_state(current, |
519 | dev_cgroup = cgroup_to_devcgroup(cgroup); | 518 | devices_subsys_id)); |
520 | if (!dev_cgroup) | 519 | if (!dev_cgroup) |
521 | return 0; | 520 | return 0; |
522 | 521 | ||
@@ -547,12 +546,11 @@ acc_check: | |||
547 | 546 | ||
548 | int devcgroup_inode_mknod(int mode, dev_t dev) | 547 | int devcgroup_inode_mknod(int mode, dev_t dev) |
549 | { | 548 | { |
550 | struct cgroup *cgroup; | ||
551 | struct dev_cgroup *dev_cgroup; | 549 | struct dev_cgroup *dev_cgroup; |
552 | struct dev_whitelist_item *wh; | 550 | struct dev_whitelist_item *wh; |
553 | 551 | ||
554 | cgroup = task_cgroup(current, devices_subsys.subsys_id); | 552 | dev_cgroup = css_to_devcgroup(task_subsys_state(current, |
555 | dev_cgroup = cgroup_to_devcgroup(cgroup); | 553 | devices_subsys_id)); |
556 | if (!dev_cgroup) | 554 | if (!dev_cgroup) |
557 | return 0; | 555 | return 0; |
558 | 556 | ||