]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/9p/trans_fd.c
[PATCH] v9fs: fix for access to unitialized variables or freed memory
[mirror_ubuntu-zesty-kernel.git] / fs / 9p / trans_fd.c
index 1a28ef97a3d116f9aa307443794ffe6314fefb60..5b2ce21b10fab55b6bf6e5db54b615d3c961c2ea 100644 (file)
@@ -80,6 +80,7 @@ static int v9fs_fd_send(struct v9fs_transport *trans, void *v, int len)
        if (!trans || trans->status != Connected || !ts)
                return -EIO;
 
+       oldfs = get_fs();
        set_fs(get_ds());
        /* The cast to a user pointer is valid due to the set_fs() */
        ret = vfs_write(ts->out_file, (void __user *)v, len, &ts->out_file->f_pos);