提交 fe529537 编写于 作者: S Sjur Brændeland 提交者: Rusty Russell

virtio_console: Free buffer if splice fails

Free the allocated scatter list if send_pages fails in function
port_splice_write.
Signed-off-by: NSjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
上级 de929b04
...@@ -881,6 +881,8 @@ static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe, ...@@ -881,6 +881,8 @@ static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe,
if (likely(ret > 0)) if (likely(ret > 0))
ret = send_pages(port, sgl.sg, sgl.n, sgl.len, true); ret = send_pages(port, sgl.sg, sgl.n, sgl.len, true);
if (unlikely(ret <= 0))
kfree(sgl.sg);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册