Fix crash when usb_bulk_read() fails.

This commit is contained in:
Romain Tartiere 2011-05-18 22:25:09 +00:00
parent 6d66866268
commit 4828211e97

View file

@ -77,7 +77,8 @@ int
pn53x_usb_bulk_read (struct pn53x_usb_data *data, byte_t abtRx[], const size_t szRx) pn53x_usb_bulk_read (struct pn53x_usb_data *data, byte_t abtRx[], const size_t szRx)
{ {
int res = usb_bulk_read (data->pudh, data->uiEndPointIn, (char *) abtRx, szRx, USB_TIMEOUT); int res = usb_bulk_read (data->pudh, data->uiEndPointIn, (char *) abtRx, szRx, USB_TIMEOUT);
PRINT_HEX ("RX", abtRx, res); if (res > 0)
PRINT_HEX ("RX", abtRx, res);
return res; return res;
} }
int int