Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3200198pxb; Mon, 9 Nov 2020 05:26:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRV92NVoe/QIa68D8sScXSGGs6dxlUBPqM5pL1smgecBzY/18ayFxx7ZlINoRfHV2iw8/a X-Received: by 2002:a17:906:f296:: with SMTP id gu22mr14419152ejb.475.1604928407774; Mon, 09 Nov 2020 05:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928407; cv=none; d=google.com; s=arc-20160816; b=B/s2OzQ9C13IpH5VaID4pQHYrwzEN0qsEcPY3DyKt/2HTVaUfC3JYxmujUPH9W8ur9 XzOCWYyLi1SWSpROBvuLzzIk2fyZ+AoNszhXKVjFHfF9nWBu2OaDzlT4zh1YwGHYGknN i6juwlkMjKzeW/e4L9EzPy0yNLaAXMSlUT5ib0mMbY8VEg9iXNOMwaRo9hCmzGgjxfQz QguTzyXtpRrSsPDfDpX10MHHTCKRC0ylydGfLwZuZ4Qyg8K7GBgCQVX4x9S64oNs6e9Q upjJYYYat8mBrTjYZD1LUp0s78hweBqUPrztWWFr5SCjgOgQaiE+T32/gTTn+Nh/llRS SiGQ== 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=dExZ/POpi2iYiIIx5FBXrc06Y4da2LsvaSJXS07uuqY=; b=FeCN24H1sbSTN9L3gq0gV2FPgnMhfo84GusoVVpM7Dz5U4I5lxXHEBmD2JvG/+fcfr Q6SJm6QQepHpvRwzWXGHiw7fncz/MWi68IgjHn90Prd7XwstX5/bomx3x5bmOW4YYRlA xvnZysGl4NpKtneu3dahUg85LNknnr1jjsSfM6wjYm4XZG3110Np8E5NN/Sp+DXV/eRc V0CcjLPbw/eTfhRofknk8rL6eVuwaXe6nN3ZnYZmQFeNQwzqw//KsoH1Sd8l6gwNX3sH rE65s3VzsSI6PVOZv6t+NaVL1wBMHpIt6GlTKzdxu3rwbDWQ3ZkLP9ocpt0f3UxfUEd/ 4eXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oIhLZA7s; 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 q3si7074789edv.85.2020.11.09.05.26.25; Mon, 09 Nov 2020 05:26:47 -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=oIhLZA7s; 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 S2387425AbgKINVN (ORCPT + 99 others); Mon, 9 Nov 2020 08:21:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:48886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731378AbgKINVJ (ORCPT ); Mon, 9 Nov 2020 08:21:09 -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 B747B20731; Mon, 9 Nov 2020 13:21:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604928068; bh=8jU8YRDsnJQt9GoP2tCqObzSV/epvN9YXHzwMWPz1cw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oIhLZA7sixmh5b2tVx6i7iUjbcCPcghaW0lQEeMNMx/9mPdQzOsTmMQnb1/EmnnqC J7j5hjrdf9Lb/3NO4FraUsodRofsxryGD7qelwLwu8ReuINz2uOWN1F869yFU785u+ DAqw0mYEKm7K6EdNm79jh0D3D2T4yKwNcamIb9h4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qinglang Miao Subject: [PATCH 5.9 116/133] serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init Date: Mon, 9 Nov 2020 13:56:18 +0100 Message-Id: <20201109125036.269355216@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125030.706496283@linuxfoundation.org> References: <20201109125030.706496283@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 @@ -1280,6 +1280,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;