aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/selinuxfs.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 65efa8f76331..cc782083d71f 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -710,7 +710,6 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf,
710{ 710{
711 char *page = NULL; 711 char *page = NULL;
712 ssize_t length; 712 ssize_t length;
713 ssize_t end;
714 ssize_t ret; 713 ssize_t ret;
715 int cur_enforcing; 714 int cur_enforcing;
716 struct inode *inode; 715 struct inode *inode;
@@ -741,24 +740,7 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf,
741 740
742 length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing, 741 length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing,
743 bool_pending_values[inode->i_ino - BOOL_INO_OFFSET]); 742 bool_pending_values[inode->i_ino - BOOL_INO_OFFSET]);
744 if (length < 0) { 743 ret = simple_read_from_buffer(buf, count, ppos, page, length);
745 ret = length;
746 goto out;
747 }
748
749 if (*ppos >= length) {
750 ret = 0;
751 goto out;
752 }
753 if (count + *ppos > length)
754 count = length - *ppos;
755 end = count + *ppos;
756 if (copy_to_user(buf, (char *) page + *ppos, count)) {
757 ret = -EFAULT;
758 goto out;
759 }
760 *ppos = end;
761 ret = count;
762out: 744out:
763 mutex_unlock(&sel_mutex); 745 mutex_unlock(&sel_mutex);
764 if (page) 746 if (page)