From: Samuel Ortiz Date: Tue, 29 May 2012 19:28:58 +0000 (+0200) Subject: NFC: Unregister device if pn533 initial configuration fails X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9f2f8ba172d9a7f7f600ced18b05f6fd52b83396;p=linux-beck.git NFC: Unregister device if pn533 initial configuration fails Signed-off-by: Samuel Ortiz --- 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: