From patchwork Wed May 29 02:33:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Libo Chen X-Patchwork-Id: 247117 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id D0D162C03FE for ; Wed, 29 May 2013 15:57:42 +1000 (EST) X-Greylist: delayed 372 seconds by postgrey-1.34 at bilbo; Wed, 29 May 2013 12:40:38 EST Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [119.145.14.65]) (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits)) (Client CN "myname.my.domain", Issuer "www.mirapoint.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 9203B2C0345 for ; Wed, 29 May 2013 12:40:38 +1000 (EST) Received: from 172.24.2.119 (EHLO szxeml205-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BCH43235; Wed, 29 May 2013 10:34:02 +0800 (CST) Received: from SZXEML451-HUB.china.huawei.com (10.82.67.194) by szxeml205-edg.china.huawei.com (172.24.2.58) with Microsoft SMTP Server (TLS) id 14.1.323.7; Wed, 29 May 2013 10:33:24 +0800 Received: from [127.0.0.1] (10.135.72.158) by szxeml451-hub.china.huawei.com (10.82.67.194) with Microsoft SMTP Server id 14.1.323.7; Wed, 29 May 2013 10:33:19 +0800 Message-ID: <51A568EC.2070103@huawei.com> Date: Wed, 29 May 2013 10:33:16 +0800 From: Libo Chen User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: , Greg KH Subject: [PATCH] driver: tty: add missing unregister in err case X-Originating-IP: [10.135.72.158] X-CFilter-Loop: Reflected X-Mailman-Approved-At: Wed, 29 May 2013 15:57:06 +1000 Cc: jslaby@suse.cz, linux-kernel@vger.kernel.org, Rob Herring , Li Zefan , linux-serial@vger.kernel.org, Grant Likely , linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" when platform_driver_register broken, we should unregister ucc_uart_driver Signed-off-by: Libo chen --- drivers/tty/serial/ucc_uart.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index 7355303..f86f447 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -1518,9 +1518,11 @@ static int __init ucc_uart_init(void) } ret = platform_driver_register(&ucc_uart_of_driver); - if (ret) + if (ret) { printk(KERN_ERR "ucc-uart: could not register platform driver\n"); + uart_unregister_driver(&ucc_uart_driver); + } return ret; }