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: ae1cca3fa3 ("serial: uartps: Change uart ID port allocation")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Wei Yongjun 2018-09-25 14:23:21 +00:00 committed by Greg Kroah-Hartman
parent 377fedd186
commit 823f4e53f0

View file

@ -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++;
}