Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe529537 authored by Sjur Brændeland's avatar Sjur Brændeland Committed by Rusty Russell
Browse files

virtio_console: Free buffer if splice fails



Free the allocated scatter list if send_pages fails in function
port_splice_write.

Signed-off-by: default avatarSjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent de929b04
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
}