]> git.karo-electronics.de Git - linux-beck.git/commitdiff
NFC: Unregister device if pn533 initial configuration fails
authorSamuel Ortiz <sameo@linux.intel.com>
Tue, 29 May 2012 19:28:58 +0000 (21:28 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 4 Jun 2012 19:34:32 +0000 (21:34 +0200)
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/pn533.c

index 6b8a65ca0d716dc4d6250cb9998000a3496ba361..2a7e4e8e4f11fb9ffc0f5ca9537e080601f5ac11 100644 (file)
@@ -2112,13 +2112,17 @@ static int pn533_probe(struct usb_interface *interface,
        if (rc) {
                nfc_dev_err(&dev->interface->dev, "Error on setting MAX_RETRIES"
                                                                " config");
-               goto free_nfc_dev;
+               goto unregister_nfc_dev;
        }
 
        return 0;
 
+unregister_nfc_dev:
+       nfc_unregister_device(dev->nfc_dev);
+
 free_nfc_dev:
        nfc_free_device(dev->nfc_dev);
+
 destroy_wq:
        destroy_workqueue(dev->wq);
 error: