X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Fbinfmt_misc.c;h=72d0b412c376641428244fac1acab7684b7cc748;hb=affd872ebbe4f045d70a3f4b33b20f5f6c894bcc;hp=18657f001b43ba8b1393da95cb7b0481910ba937;hpb=02a93208edec0d655c9f18613d830dc6afeda7d4;p=linux-2.6-omap-h63xx.git diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 18657f001b4..72d0b412c37 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -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,