Skip to content

Commit

Permalink
NFC: Unregister device if pn533 initial configuration fails
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Samuel Ortiz committed Jun 4, 2012
1 parent 7c2a04a commit 9f2f8ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/nfc/pn533.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9f2f8ba

Please sign in to comment.