From 79344ae0c90fc47245a5bb27c41fbb9b5b0ef7e8 Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Wed, 22 Mar 2006 00:09:15 -0800 Subject: [PATCH] --- yaml --- r: 22508 b: refs/heads/master c: 68bdcf28a8d245208a02dc9caa60fe13cc1b0ea8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/security/selinux/selinuxfs.c | 20 +------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/[refs] b/[refs] index 5278551ca46c..4dbbdc80edfc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bb0030797f55c9996ea1cebd16b65750ceb7e4fd +refs/heads/master: 68bdcf28a8d245208a02dc9caa60fe13cc1b0ea8 diff --git a/trunk/security/selinux/selinuxfs.c b/trunk/security/selinux/selinuxfs.c index 65efa8f76331..cc782083d71f 100644 --- a/trunk/security/selinux/selinuxfs.c +++ b/trunk/security/selinux/selinuxfs.c @@ -710,7 +710,6 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf, { char *page = NULL; ssize_t length; - ssize_t end; ssize_t ret; int cur_enforcing; struct inode *inode; @@ -741,24 +740,7 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf, length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing, bool_pending_values[inode->i_ino - BOOL_INO_OFFSET]); - if (length < 0) { - ret = length; - goto out; - } - - if (*ppos >= length) { - ret = 0; - goto out; - } - if (count + *ppos > length) - count = length - *ppos; - end = count + *ppos; - if (copy_to_user(buf, (char *) page + *ppos, count)) { - ret = -EFAULT; - goto out; - } - *ppos = end; - ret = count; + ret = simple_read_from_buffer(buf, count, ppos, page, length); out: mutex_unlock(&sel_mutex); if (page)