From f01b73ab32c1cfb57bb81d217056cd5d3e6f44fa Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Thu, 29 Jul 2010 10:47:53 +0000 Subject: [PATCH] Move usb_reset(3) call. As the documentation states, and as reported in isssue 81 (fixed in r421), usb_reset()'s argument is invalid after the call and so usb_close(3) must be called before usb_reset(3). --- libnfc/drivers/pn53x_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnfc/drivers/pn53x_usb.c b/libnfc/drivers/pn53x_usb.c index 6b08daa..101525b 100644 --- a/libnfc/drivers/pn53x_usb.c +++ b/libnfc/drivers/pn53x_usb.c @@ -232,9 +232,9 @@ void pn53x_usb_disconnect(nfc_device_t* pnd) if((ret = usb_release_interface(pus->pudh,0)) < 0) DBG("usb_release failed %i",ret); DBG("%s","resetting USB"); - usb_reset(pus->pudh); if((ret = usb_close(pus->pudh)) < 0) DBG("usb_close failed %i",ret); + usb_reset(pus->pudh); free(pnd->nds); free(pnd); DBG("%s","done!");