]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
mxser: fix xmit_buf leak in activate when LSR == 0xff
authorJiri Slaby <jslaby@suse.cz>
Mon, 24 Jan 2022 07:14:24 +0000 (08:14 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 13:19:06 +0000 (15:19 +0200)
commit9c379f3073b55d889d2330a7e7069d7a0e73ba80
tree1d9b03df4e9c23d3b03d7f468d9eef0ffa74d573
parent56739663f5d56cf539c3cca95f7102ecb8c34b98
mxser: fix xmit_buf leak in activate when LSR == 0xff

BugLink: https://bugs.launchpad.net/bugs/1971497
[ Upstream commit cd3a4907ee334b40d7aa880c7ab310b154fd5cd4 ]

When LSR is 0xff in ->activate() (rather unlike), we return an error.
Provided ->shutdown() is not called when ->activate() fails, nothing
actually frees the buffer in this case.

Fix this by properly freeing the buffer in a designated label. We jump
there also from the "!info->type" if now too.

Fixes: 6769140d3047 ("tty: mxser: use the tty_port_open method")
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220124071430.14907-6-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/tty/mxser.c