summaryrefslogtreecommitdiff
path: root/drivers/nfc
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-05-29 21:28:58 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-06-04 21:34:32 +0200
commit9f2f8ba172d9a7f7f600ced18b05f6fd52b83396 (patch)
tree6aea00966e112cd1bbb9985a36d4d2ccc1e21c46 /drivers/nfc
parent7c2a04a933d51b45af7660bd1790339eb3c33308 (diff)
NFC: Unregister device if pn533 initial configuration fails
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/pn533.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 6b8a65ca0d71..2a7e4e8e4f11 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -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: