Skip to content

Commit

Permalink
serial: uartps: Fix missing unlock on error in cdns_get_id()
Browse files Browse the repository at this point in the history
Add the missing unlock before return from function cdns_get_id()
in the error handling case.

Fixes: ae1cca3 ("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>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Oct 2, 2018
1 parent 377fedd commit 823f4e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/tty/serial/xilinx_uartps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down

0 comments on commit 823f4e5

Please sign in to comment.