Return-Path: Received: from mail-by2nam03on0128.outbound.protection.outlook.com ([104.47.42.128]:37280 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933058AbeCCWd5 (ORCPT ); Sat, 3 Mar 2018 17:33:57 -0500 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Andrey Rusalin , Samuel Ortiz , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 095/219] NFC: pn533: change order of free_irq and dev unregistration Date: Sat, 3 Mar 2018 22:28:50 +0000 Message-ID: <20180303222716.26640-95-alexander.levin@microsoft.com> References: <20180303222716.26640-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222716.26640-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Andrey Rusalin [ Upstream commit 068a496c4525c638ffab56449d905b88ef97fe32 ] Change order of free_irq and dev unregistration. It fixes situation when device already unregistered and an interrupt happens and nobody can handle it. Signed-off-by: Andrey Rusalin Signed-off-by: Samuel Ortiz Signed-off-by: Sasha Levin --- drivers/nfc/pn533/i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/pn533/i2c.c b/drivers/nfc/pn533/i2c.c index 1dc89248e58e..11d78b43cf76 100644 --- a/drivers/nfc/pn533/i2c.c +++ b/drivers/nfc/pn533/i2c.c @@ -242,10 +242,10 @@ static int pn533_i2c_remove(struct i2c_client *client= ) =20 dev_dbg(&client->dev, "%s\n", __func__); =20 - pn533_unregister_device(phy->priv); - free_irq(client->irq, phy); =20 + pn533_unregister_device(phy->priv); + return 0; } =20 --=20 2.14.1