X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fproc%2Fbase.c;h=989af5e55d1bec761b8a2604d6e8528713d7d8da;hb=826fad1b93fdb4ffacfd9cd860f06140e852e377;hp=01f7769da8e67bf7f7091f6ece8ca09b060b859f;hpb=63967fa911c2c49376d0b1e171ef98e1b2b075af;p=powerpc.git diff --git a/fs/proc/base.c b/fs/proc/base.c index 01f7769da8..989af5e55d 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1558,29 +1558,20 @@ static ssize_t proc_pid_attr_read(struct file * file, char __user * buf, size_t count, loff_t *ppos) { struct inode * inode = file->f_path.dentry->d_inode; - unsigned long page; + char *p = NULL; ssize_t length; struct task_struct *task = get_proc_task(inode); - length = -ESRCH; if (!task) - goto out_no_task; - - if (count > PAGE_SIZE) - count = PAGE_SIZE; - length = -ENOMEM; - if (!(page = __get_free_page(GFP_KERNEL))) - goto out; + return -ESRCH; length = security_getprocattr(task, (char*)file->f_path.dentry->d_name.name, - (void*)page, count); - if (length >= 0) - length = simple_read_from_buffer(buf, count, ppos, (char *)page, length); - free_page(page); -out: + &p); put_task_struct(task); -out_no_task: + if (length > 0) + length = simple_read_from_buffer(buf, count, ppos, p, length); + kfree(p); return length; }