From patchwork Tue Sep 25 14:23:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 10614073 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1613F14DA for ; Tue, 25 Sep 2018 14:15:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05EC029684 for ; Tue, 25 Sep 2018 14:15:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDA7A296B8; Tue, 25 Sep 2018 14:15:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2CD3929684 for ; Tue, 25 Sep 2018 14:15:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=TEpgW/wWmDdJEYBxW9+K9LZKcC1TTthvJlNWXLGjUZM=; b=INhwd5qfXBFbGJ T2hZ5Cfi75xLOC9hPuV3QbcWv+MmrGGnRUGOSEr8QdT+Hfd5/DDPndiyTun8CaF6+5CmGqP0ZixDw hZGycBxQ0m2EebYupot/C/Q0aLnlj7I5su9CnO50qkb2UbDQADO6sqS4iepXVhvLU/kfYhuTTZTyF XNLKQaLLeYdsRvmLk+XtEfSKIDL18SAizzq25Ta/vegi5Eqq0HvYNHhXKYglV0U0iPq1wxzP87O7U VHnLAHXZa9/T7srONlQmUDPOpyVVsNGOxa+HSGHEZ4tf+slZu7VuyELDGD4rD8Qp3JbIc8h4vd6gu ffgLn0dF335IB+eZZ9RQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g4o7O-0001vv-9V; Tue, 25 Sep 2018 14:15:14 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g4o70-0001tF-8d for linux-arm-kernel@lists.infradead.org; Tue, 25 Sep 2018 14:14:51 +0000 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 14587ED153185; Tue, 25 Sep 2018 22:14:08 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.399.0; Tue, 25 Sep 2018 22:14:01 +0800 From: Wei Yongjun To: Greg Kroah-Hartman , Jiri Slaby , Michal Simek Subject: [PATCH -next] serial: uartps: Fix missing unlock on error in cdns_get_id() Date: Tue, 25 Sep 2018 14:23:21 +0000 Message-ID: <1537885401-18605-1-git-send-email-weiyongjun1@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180925_071450_528185_16042944 X-CRM114-Status: GOOD ( 10.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, Wei Yongjun , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/tty/serial/xilinx_uartps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index f77200a..0e3dae4 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++; }