projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de929b0
)
virtio_console: Free buffer if splice fails
author
Sjur Brændeland
<sjur.brandeland@stericsson.com>
Mon, 15 Oct 2012 07:57:33 +0000
(09:57 +0200)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Tue, 18 Dec 2012 04:50:39 +0000
(15:20 +1030)
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>
drivers/char/virtio_console.c
patch
|
blob
|
history
diff --git
a/drivers/char/virtio_console.c
b/drivers/char/virtio_console.c
index 6a369942da84fa3ff913b486608e35af153a78db..09d193dbb23320570ecc1c8d47e8757c57cdca6e 100644
(file)
--- 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,
if (likely(ret > 0))
ret = send_pages(port, sgl.sg, sgl.n, sgl.len, true);
+ if (unlikely(ret <= 0))
+ kfree(sgl.sg);
return ret;
}