summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2011-06-08 17:31:21 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-06-08 17:31:21 -0700
commit5a84ba3c21d1df214e8e95beee95ba5dbc4449f5 (patch)
tree1e11d19c69a70374972c1e0b1821ac265e63b224 /src
parent4812a72ceaada294477b4c2015c42cb8bcbe93a4 (diff)
parent055a5f9542ba8fcfd2972111b707049732255ebe (diff)
downloadexternal_libnfc-nxp-5a84ba3c21d1df214e8e95beee95ba5dbc4449f5.zip
external_libnfc-nxp-5a84ba3c21d1df214e8e95beee95ba5dbc4449f5.tar.gz
external_libnfc-nxp-5a84ba3c21d1df214e8e95beee95ba5dbc4449f5.tar.bz2
am 055a5f95: am b76c80da: am 80c2d409: Merge "Prevent NFC crash-loop if firmware cannot be loaded."
* commit '055a5f9542ba8fcfd2972111b707049732255ebe': Prevent NFC crash-loop if firmware cannot be loaded.
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 f5976b7..b47764e 100644
--- a/src/phLibNfc.c
+++ b/src/phLibNfc.c
@@ -832,10 +832,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)
{