pn53x_usb driver: verify return of pn53x_build_frame()

Problem reported by Coverity:
CID 1090322 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  unchecked_value: No check of the return value of "pn53x_build_frame(abtFrame, &szFrame, pbtData, szData)".
This commit is contained in:
Philippe Teuwen 2013-09-22 03:31:50 +02:00
parent 90160d6507
commit 2e51318bcb

View file

@ -428,7 +428,10 @@ pn53x_usb_send(nfc_device *pnd, const uint8_t *pbtData, const size_t szData, con
size_t szFrame = 0; size_t szFrame = 0;
int res = 0; int res = 0;
pn53x_build_frame(abtFrame, &szFrame, pbtData, szData); if ((res = pn53x_build_frame(abtFrame, &szFrame, pbtData, szData)) < 0) {
pnd->last_error = res;
return pnd->last_error;
}
if ((res = pn53x_usb_bulk_write(DRIVER_DATA(pnd), abtFrame, szFrame, timeout)) < 0) { if ((res = pn53x_usb_bulk_write(DRIVER_DATA(pnd), abtFrame, szFrame, timeout)) < 0) {
pnd->last_error = res; pnd->last_error = res;