Commit 32cf21ac authored by Michal Simek's avatar Michal Simek Committed by Greg Kroah-Hartman

serial: uartps: Fix error path when alloc failed

When cdns_uart_console allocation failed there is a need to also clear
ID from ID list.

Fixes: ae1cca3f ("serial: uartps: Change uart ID port allocation")
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 82b1b2ec
...@@ -1508,8 +1508,10 @@ static int cdns_uart_probe(struct platform_device *pdev) ...@@ -1508,8 +1508,10 @@ static int cdns_uart_probe(struct platform_device *pdev)
#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
cdns_uart_console = devm_kzalloc(&pdev->dev, sizeof(*cdns_uart_console), cdns_uart_console = devm_kzalloc(&pdev->dev, sizeof(*cdns_uart_console),
GFP_KERNEL); GFP_KERNEL);
if (!cdns_uart_console) if (!cdns_uart_console) {
return -ENOMEM; rc = -ENOMEM;
goto err_out_id;
}
strncpy(cdns_uart_console->name, CDNS_UART_TTY_NAME, strncpy(cdns_uart_console->name, CDNS_UART_TTY_NAME,
sizeof(cdns_uart_console->name)); sizeof(cdns_uart_console->name));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment