From: Wei Yongjun Date: Tue, 25 Sep 2018 14:23:21 +0000 (+0000) Subject: serial: uartps: Fix missing unlock on error in cdns_get_id() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=823f4e53f0f2beef4ae43b0a8b33e27b0761b840;p=openwrt%2Fstaging%2Fblogic.git serial: uartps: Fix missing unlock on error in cdns_get_id() Add the missing unlock before return from function cdns_get_id() in the error handling case. Fixes: ae1cca3fa347 ("serial: uartps: Change uart ID port allocation") Signed-off-by: Wei Yongjun Reviewed-by: Michal Simek Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index f77200a0f461..0e3dae461f71 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1394,8 +1394,10 @@ static int cdns_get_id(struct platform_device *pdev) if (!alias_bitmap_initialized) { ret = of_alias_get_alias_list(cdns_uart_of_match, "serial", alias_bitmap, MAX_UART_INSTANCES); - if (ret) + if (ret) { + mutex_unlock(&bitmap_lock); return ret; + } alias_bitmap_initialized++; }