Fix segfault in pn53x_initiator_transceive_bytes when pszRx in NULL

Cause was "return *pszRx"
Segfault occured when listing a typeB'
This commit is contained in:
Philippe Teuwen 2012-05-18 21:54:55 +00:00
parent 969102c1a0
commit ff87cf62b1

View file

@ -1332,7 +1332,7 @@ pn53x_initiator_transceive_bytes (struct nfc_device *pnd, const uint8_t *pbtTx,
memcpy (pbtRx, abtRx + 1, *pszRx); memcpy (pbtRx, abtRx + 1, *pszRx);
} }
// Everything went successful, we return received bytes count // Everything went successful, we return received bytes count
return *pszRx; return (szRx - 1);
} }
static void __pn53x_init_timer(struct nfc_device *pnd, const uint32_t max_cycles) static void __pn53x_init_timer(struct nfc_device *pnd, const uint32_t max_cycles)