]> git.hungrycats.org Git - linux/commitdiff
[VLAN]: Fix memory leak in procfs handling.
authorOleg Drokin <green@linuxhacker.ru>
Sun, 9 Mar 2003 06:00:34 +0000 (22:00 -0800)
committerDavid S. Miller <davem@nuts.ninka.net>
Sun, 9 Mar 2003 06:00:34 +0000 (22:00 -0800)
net/8021q/vlanproc.c

index b72b075434af47a1afbe7f7ba1aeaa8cf454e8ce..be15a34cfbdb997e10492ac7226cc08a5b363d8f 100644 (file)
@@ -251,8 +251,10 @@ static ssize_t vlan_proc_read(struct file *file, char *buf,
        offs = file->f_pos;
        if (offs < pos) {
                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;
+               }
 
                file->f_pos += len;
        } else {