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:
parent
90160d6507
commit
2e51318bcb
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue