NFC: pn533: change order of free_irq and dev unregistration
authorAndrey Rusalin <arusalin@dev.rtsoft.ru>
Wed, 28 Dec 2016 17:10:57 +0000 (20:10 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Sat, 1 Apr 2017 23:06:21 +0000 (01:06 +0200)
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 <arusalin@dev.rtsoft.ru>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/pn533/i2c.c

index 1dc89248e58e5b2876490fb926c80c350d239cda..11d78b43cf76c658989504d0fad328aca89851f7 100644 (file)
@@ -242,10 +242,10 @@ static int pn533_i2c_remove(struct i2c_client *client)
 
        dev_dbg(&client->dev, "%s\n", __func__);
 
-       pn533_unregister_device(phy->priv);
-
        free_irq(client->irq, phy);
 
+       pn533_unregister_device(phy->priv);
+
        return 0;
 }