diff options
author | Sjur Brændeland <sjur.brandeland@stericsson.com> | 2012-10-15 03:57:33 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-12-17 23:50:39 -0500 |
commit | fe5295374ec9ac56ba3b619c5c1792b3fd66d859 (patch) | |
tree | 63fc2e035669b7b44b3babc452b48ae49769787d /drivers/char | |
parent | de929b04450f2ec984c2febb1249d0e0f993d0a2 (diff) |
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>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/virtio_console.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 6a369942da84..09d193dbb233 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -881,6 +881,8 @@ static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe, | |||
881 | if (likely(ret > 0)) | 881 | if (likely(ret > 0)) |
882 | ret = send_pages(port, sgl.sg, sgl.n, sgl.len, true); | 882 | ret = send_pages(port, sgl.sg, sgl.n, sgl.len, true); |
883 | 883 | ||
884 | if (unlikely(ret <= 0)) | ||
885 | kfree(sgl.sg); | ||
884 | return ret; | 886 | return ret; |
885 | } | 887 | } |
886 | 888 | ||