mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 22:51:42 +00:00
virtio_console: Free buffer if splice fails
Free the allocated scatter list if send_pages fails in function port_splice_write. Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
de929b0445
commit
fe5295374e
@ -881,6 +881,8 @@ static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe,
|
||||
if (likely(ret > 0))
|
||||
ret = send_pages(port, sgl.sg, sgl.n, sgl.len, true);
|
||||
|
||||
if (unlikely(ret <= 0))
|
||||
kfree(sgl.sg);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user