Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3195603pxb; Mon, 9 Nov 2020 05:20:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyk5yAanVb7rnj5hKvtLIpIz83yQNgPu0v7lLi8HERv8vHeMm67fP7ObXAL/6YgwBmhQB7d X-Received: by 2002:a17:906:aacb:: with SMTP id kt11mr7036228ejb.12.1604928014278; Mon, 09 Nov 2020 05:20:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928014; cv=none; d=google.com; s=arc-20160816; b=KVzygdPONMeeCHnVwmDsXn77uNzcVm+Z44NRUXTfDxltMxlNTcKBe+hfVtc8zW+LIp 4CFDdpQiUYjTNjZ9/MIwy822Ibr1NgKuCvgn54hr3svnbESHIznly1/1QARggqerK6fb 5/VfZZJVPKnIRk5JoQBJYs7AfqYooWgDqU40Dek6DhlAA5GmTas/0uagu5lVHMvQxV/J hyDuAQrEtU0r07tlWCTRHmF9mkr+R+e/i2iU/ahTFB/k0y2MoEFiVSuzRPlVmq9JJBgg 5cNcypnDTMU7urtLxTeGOirk1Tf+0Mgmz487HQREGNhavOE0xTNwMbRgOLEFV5KJnfYe jQLQ== 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=lyJ+5aRLu2gQw9Q2gUREKpevl4nrmt3BCmiqeZSFoPo=; b=h6cdNd1JvMAdZzulC5lRsM7rG8tTtMpGrwGd3KOqpo1FoJlFCvb5O1mZFoXFEiCJSb 5/n7tGBIjzicwstvrjLWEdZeFWjH2roRlDTLNeLfolGuswjsiloC3QMHI8OjuSLkLUSz hhGs/4J0sEm3/JxjJrZu59O/K98h2sMIe04YAGKZfdrBzgNrPbpOzzXEx7JRk7jMqFvo DwvV+U4mrD/BehMedY3Z9xanoizyfO1dWSC8JzBNbCFkj3xcOIe9fHr86Amx6/RZNWg+ 7+brFxPsWQPN+vwDgrXUHWnjbBmlWfLLjtKqK+DWvyC8Lq115LyHT6wXC2rfHYg8bQpu pKsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L26MbNPA; 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 n24si6778273ejz.56.2020.11.09.05.19.50; Mon, 09 Nov 2020 05:20:14 -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=L26MbNPA; 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 S1732149AbgKINPo (ORCPT + 99 others); Mon, 9 Nov 2020 08:15:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:42536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731465AbgKINPl (ORCPT ); Mon, 9 Nov 2020 08:15:41 -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 1E7B320663; Mon, 9 Nov 2020 13:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927740; bh=aU0X+vspKPz/trM5irzfYl9cuVj4+KMoef4DW7vHJqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L26MbNPA2FWrf8NwTZ8CUWo2vxjQNeq2OMLppdyqHVH/mjHztJouoxVUPVELzWNYh Ilkua7dKz7M9cN+hkv6Inno7dupkwhWbjc5jxFpH5y6bK76T4SkMqyHDcoETTYd4SU VklMa3kJyRAUgI7cMBD8vHRDWdpVXsVk07xsC+/w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qinglang Miao Subject: [PATCH 5.4 68/85] serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init Date: Mon, 9 Nov 2020 13:56:05 +0100 Message-Id: <20201109125025.838639541@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125022.614792961@linuxfoundation.org> References: <20201109125022.614792961@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 @@ -1283,6 +1283,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;