OpenCloudOS-Kernel/drivers/pps/clients
Ma Ke 73c1928a00 pps: add an error check in parport_attach
[ Upstream commit 62c5a01a5711c8e4be8ae7b6f0db663094615d48 ]

In parport_attach, the return value of ida_alloc is unchecked, witch leads
to the use of an invalid index value.

To address this issue, index should be checked. When the index value is
abnormal, the device should be freed.

Found by code review, compile tested only.

Cc: stable@vger.kernel.org
Fixes: fb56d97df7 ("pps: client: use new parport device model")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Acked-by: Rodolfo Giometti <giometti@enneenne.com>
Link: https://lore.kernel.org/r/20240828131814.3034338-1-make24@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-10-04 16:29:58 +02:00
..
Kconfig
Makefile
pps-gpio.c pps: clients: gpio: Propagate return value from pps_gpio_probe 2022-02-04 15:33:42 +01:00
pps-ktimer.c
pps-ldisc.c tty/serial: Make ->dcd_change()+uart_handle_dcd_change() status bool active 2023-01-19 16:04:35 +01:00
pps_parport.c pps: add an error check in parport_attach 2024-10-04 16:29:58 +02:00