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

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
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1508,8 +1508,10 @@ static int cdns_uart_probe(struct platform_device *pdev)
#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
	cdns_uart_console = devm_kzalloc(&pdev->dev, sizeof(*cdns_uart_console),
					 GFP_KERNEL);
	if (!cdns_uart_console)
		return -ENOMEM;
	if (!cdns_uart_console) {
		rc = -ENOMEM;
		goto err_out_id;
	}

	strncpy(cdns_uart_console->name, CDNS_UART_TTY_NAME,
		sizeof(cdns_uart_console->name));