]> git.baikalelectronics.ru Git - kernel.git/commit
serial: 8250: fix return error code in serial8250_request_std_resource()
authorYi Yang <yiyang13@huawei.com>
Tue, 28 Jun 2022 08:35:15 +0000 (16:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 18:59:28 +0000 (20:59 +0200)
commit1e23dd56e5f9db9a6742cea76810fbb5d68e8c93
treed29bb497ad03bd6c69fbe5fff0a90282696631f4
parentec7d997876f121ea3e86adcba087e1ebc15947aa
serial: 8250: fix return error code in serial8250_request_std_resource()

commit cf099a64197a48b74b5378ebb7caa73c43cb62a0 upstream.

If port->mapbase = NULL in serial8250_request_std_resource() , it need
return a error code instead of 0. If uart_set_info() fail to request new
regions by serial8250_request_std_resource() but the return value of
serial8250_request_std_resource() is 0, The system incorrectly considers
that the resource application is successful and does not attempt to
restore the old setting. A null pointer reference is triggered when the
port resource is later invoked.

Signed-off-by: Yi Yang <yiyang13@huawei.com>
Cc: stable <stable@kernel.org>
Link: https://lore.kernel.org/r/20220628083515.64138-1-yiyang13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_port.c