summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/phHal4Nfc.c4
-rw-r--r--src/phLibNfc.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/src/phHal4Nfc.c b/src/phHal4Nfc.c
index ebd447f..c3599a6 100644
--- a/src/phHal4Nfc.c
+++ b/src/phHal4Nfc.c
@@ -302,8 +302,8 @@ phHal4Nfc_Configure_Layers(
#include <utils/Log.h>
#include <dlfcn.h>
-const unsigned char *nxp_nfc_full_version;
-const unsigned char *nxp_nfc_fw;
+const unsigned char *nxp_nfc_full_version = NULL;
+const unsigned char *nxp_nfc_fw = NULL;
int dlopen_firmware() {
void *p;
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)
{