summaryrefslogtreecommitdiff
path: root/src/phLibNfc.c
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2011-06-02 14:15:21 -0700
committerJean-Baptiste Queru <jbq@google.com>2011-06-02 15:43:47 -0700
commitac9c8c89d16e2c458c9c43e1def75d4e1f8f5b9b (patch)
tree043f566a62a3924993f21850d8b7a594188ed618 /src/phLibNfc.c
parent7825db42b02c4ad3426d258e1590b01f5547f06b (diff)
downloadlibnfc-nxp-ac9c8c89d16e2c458c9c43e1def75d4e1f8f5b9b.tar.gz
Prevent NFC crash-loop if firmware cannot be loaded.
Don't crash - just run off whatever firmware is in the chip now. Change-Id: I0d24c13452271aed63a5a0aea236db7b1cbd432c
Diffstat (limited to 'src/phLibNfc.c')
-rw-r--r--src/phLibNfc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/phLibNfc.c b/src/phLibNfc.c
index 9c7db4f..db6fd26 100644
--- a/src/phLibNfc.c
+++ b/src/phLibNfc.c
@@ -826,10 +826,14 @@ NFCSTATUS phLibNfc_Mgt_GetstackCapabilities(
gpphLibContext->psHwReference->device_info.model_id;
(void)memcpy(phLibNfc_StackCapabilities->psDevCapabilities.full_version,
gpphLibContext->psHwReference->device_info.full_version,NXP_FULL_VERSION_LEN);
-
/* Check the firmware version */
- phLibNfc_StackCapabilities->psDevCapabilities.firmware_update_info = memcmp(phLibNfc_StackCapabilities->psDevCapabilities.full_version, nxp_nfc_full_version,
- NXP_FULL_VERSION_LEN);
+ if (nxp_nfc_full_version == NULL) {
+ // Couldn't load firmware, just pretend we're up to date.
+ phLibNfc_StackCapabilities->psDevCapabilities.firmware_update_info = 0;
+ } else {
+ phLibNfc_StackCapabilities->psDevCapabilities.firmware_update_info = memcmp(phLibNfc_StackCapabilities->psDevCapabilities.full_version, nxp_nfc_full_version,
+ NXP_FULL_VERSION_LEN);
+ }
if(NFCSTATUS_SUCCESS != RetVal)
{