]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: fwserial: Fix error handling in fwserial_create
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Mon, 21 Dec 2020 12:24:35 +0000 (20:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Mar 2021 10:24:20 +0000 (11:24 +0100)
commit591e0039a073376881792deec5a458327921c4be
tree141e84a701f7503bcc41d8a6388e3a2df2d32200
parent1b1347c048e98a345f09aa1b30349b4470cacba8
staging: fwserial: Fix error handling in fwserial_create

[ Upstream commit f31559af97a0eabd467e4719253675b7dccb8a46 ]

When fw_core_add_address_handler() fails, we need to destroy
the port by tty_port_destroy(). Also we need to unregister
the address handler by fw_core_remove_address_handler() on
failure.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20201221122437.10274-1-dinghao.liu@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/fwserial/fwserial.c