Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3207924pxb; Mon, 9 Nov 2020 05:37:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJykfBEAv+rGfGyGaRyCm0wgDltFe+lCEF+59Eq15tZw9bE+ADmUGjRguclTlnsU5XAbHTZ4 X-Received: by 2002:a05:6402:1a33:: with SMTP id be19mr15701888edb.47.1604929048069; Mon, 09 Nov 2020 05:37:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929048; cv=none; d=google.com; s=arc-20160816; b=lin6Kjj+xRdUoZX9dBriWYc+uQsJIkDpW7LbU6o6uFYILw8Wg6BukEayQ5YpY/mIBG 7FrVNLqlW5LtNzxQEpMJXcX60nigciCdjRmE3jlSMKeCxPKeMyebmqxnel3cyHmZsOYL ZO9R1s0aNNAAFWoha3Ihi2/f3N5ongg3i6VeklxLoxMqfhMWBPYqhWRyDzIjxlnMeVbr lHTDkRK2cgK19RCsG4hdhHbRxRTyR+KxlPD+dyFCJ2+mhXXNCzHRj5uT08VwTGR73QX+ +fRp8N1ubUbfLfGx+g+acflPtgrde96B9HwgRlEtWqIpqua8BHiVJD4eqBj8qWfOAPW5 pyEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y6tSErD9jOJ5quBVKNEczif4ZP3uH7c82aaQv2G2biI=; b=ol5fO4hqMyGccnZ29nRZg/pUMeruoRV7ej8Z4eBwgsk4N1f1HwQYoEVohiNgeDjkbn p8BSL+BhOE3zb2bJn2k6azWmJpdblWDq4oYCIEOX1S9S8efVxaWTSZJ9309m6/R4fXty M5/g0taLcLTFSErpVl1s5KWnGdlzoDzjdp212SycAAgoCASS/Q9EMAmvla0cy9kSugij lEbthmKxgJc2Hz04gN3iggzHEk+1jnkSqAhczSrklJ+IePqb+WU52lgw2poh8jqzrXtD qVBucfGMSf+MP3LkIik4H4kt9IZk4+Z+BkF8z6qd/Y+L9A3FlqKkaQdHMtxTak7LX8dR tROQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ocdtoXJE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b16si7243576edn.23.2020.11.09.05.37.05; Mon, 09 Nov 2020 05:37:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ocdtoXJE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732939AbgKINft (ORCPT + 99 others); Mon, 9 Nov 2020 08:35:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:58042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730825AbgKINFU (ORCPT ); Mon, 9 Nov 2020 08:05:20 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C678E20684; Mon, 9 Nov 2020 13:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927105; bh=ZoIqSowvd9AcHwa//C2hMy5BtF8+rdktiD/XC6VSwCM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ocdtoXJEC4lhcK8rEqUN5lxTpTbmSDmD/g0lcFJ9Cjy77ipRLAGGDjqau0yKbph4U iIhrF0u++caCp2BQHf7fFbAoTVmQDbb/IptniQzDPcJJXlF9XAibJRq5+cDd+aoS82 rMGX597xSza8mu1Y5teAhuyY3VAqhnUSiVtujsFs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qinglang Miao Subject: [PATCH 4.9 111/117] serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init Date: Mon, 9 Nov 2020 13:55:37 +0100 Message-Id: <20201109125030.968633363@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qinglang Miao commit 0c5fc92622ed5531ff324b20f014e9e3092f0187 upstream. Add the missing platform_driver_unregister() before return from serial_txx9_init in the error handling case when failed to register serial_txx9_pci_driver with macro ENABLE_SERIAL_TXX9_PCI defined. Fixes: ab4382d27412 ("tty: move drivers/serial/ to drivers/tty/serial/") Signed-off-by: Qinglang Miao Link: https://lore.kernel.org/r/20201103084942.109076-1-miaoqinglang@huawei.com Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/serial_txx9.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c @@ -1287,6 +1287,9 @@ static int __init serial_txx9_init(void) #ifdef ENABLE_SERIAL_TXX9_PCI ret = pci_register_driver(&serial_txx9_pci_driver); + if (ret) { + platform_driver_unregister(&serial_txx9_plat_driver); + } #endif if (ret == 0) goto out;