X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Fbinfmt_misc.c;h=330fd3fe8546570732da73f6957f31dc5778eb47;hb=60a96a59569bab85571d0089682109bd3324e896;hp=18657f001b43ba8b1393da95cb7b0481910ba937;hpb=1a1c9bb433af252767ee90d6394d287afa30cf8b;p=linux-2.6-omap-h63xx.git diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 18657f001b4..330fd3fe854 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -18,7 +18,7 @@ #include #include - +#include #include #include #include @@ -675,19 +675,8 @@ static ssize_t bm_status_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { char *s = enabled ? "enabled" : "disabled"; - int len = strlen(s); - loff_t pos = *ppos; - if (pos < 0) - return -EINVAL; - if (pos >= len) - return 0; - if (len < pos + nbytes) - nbytes = len - pos; - if (copy_to_user(buf, s + pos, nbytes)) - return -EFAULT; - *ppos = pos + nbytes; - return nbytes; + return simple_read_from_buffer(buf, nbytes, ppos, s, strlen(s)); } static ssize_t bm_status_write(struct file * file, const char __user * buffer,