Commit 269b822a authored by Oleg Drokin's avatar Oleg Drokin Committed by David S. Miller

[VLAN]: Fix memory leak in procfs handling.

parent bf6120a0
...@@ -251,8 +251,10 @@ static ssize_t vlan_proc_read(struct file *file, char *buf, ...@@ -251,8 +251,10 @@ static ssize_t vlan_proc_read(struct file *file, char *buf,
offs = file->f_pos; offs = file->f_pos;
if (offs < pos) { if (offs < pos) {
len = min_t(int, pos - offs, count); len = min_t(int, pos - offs, count);
if (copy_to_user(buf, (page + offs), len)) if (copy_to_user(buf, (page + offs), len)) {
kfree(page);
return -EFAULT; return -EFAULT;
}
file->f_pos += len; file->f_pos += len;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment