From: Liang He Date: Mon, 5 Dec 2022 08:54:37 +0000 (+0800) Subject: serial: ucc_uart: Add of_node_put() in ucc_uart_remove() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6e054678ff5c10840ce801dfdb2d4898decb2b63;p=linux.git serial: ucc_uart: Add of_node_put() in ucc_uart_remove() In ucc_uart_probe(), we have added proper of_node_put() in the failure paths. However, we miss it before we free *qe_port* in the remove() function. Signed-off-by: Liang He Link: https://lore.kernel.org/r/20221205085437.1163682-1-windhl@126.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index b09b6496ee3eb..32c7a5b43f8e9 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -1468,6 +1468,8 @@ static int ucc_uart_remove(struct platform_device *ofdev) uart_remove_one_port(&ucc_uart_driver, &qe_port->port); + of_node_put(qe_port->np); + kfree(qe_port); return 0;