Commit a381471c authored by Yi Yang's avatar Yi Yang Committed by Yongqiang Liu
Browse files

serial: 8250: fix return error code in serial8250_request_std_resource()

stable inclusion
from stable-4.19.253
commit 774412bd40594620e9cbca90465eb477c4e3f09e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5I4FP


CVE: NA

--------------------------------

commit 6e690d54 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: default avatarYi Yang <yiyang13@huawei.com>
Cc: stable <stable@kernel.org>
Link: https://lore.kernel.org/r/20220628083515.64138-1-yiyang13@huawei.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent e05bdf19
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment