* [PATCH] serial: uartps: Fix error path when alloc failed
@ 2018-12-05 13:21 Michal Simek
0 siblings, 0 replies; only message in thread
From: Michal Simek @ 2018-12-05 13:21 UTC (permalink / raw)
To: linux-kernel, monstr, michal.simek, Greg Kroah-Hartman,
Shubhrajyoti Datta
Cc: Jiri Slaby, linux-serial, linux-arm-kernel
When cdns_uart_console allocation failed there is a need to also clear
ID from ID list.
Fixes: ae1cca3fa347 ("serial: uartps: Change uart ID port allocation")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/tty/serial/xilinx_uartps.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 9cdc36be5b13..c6d38617d622 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -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));
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-12-05 13:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 13:21 [PATCH] serial: uartps: Fix error path when alloc failed Michal Simek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).