diff --git a/CANopenNode b/CANopenNode index 05931a6..29c5b64 160000 --- a/CANopenNode +++ b/CANopenNode @@ -1 +1 @@ -Subproject commit 05931a6b763299cc1bff2eb8c6926f086bc55131 +Subproject commit 29c5b64131654b6f6f2171c64a1d5ce8031bcaa0 diff --git a/CO_storageLinux.c b/CO_storageLinux.c index 406d7e3..4d8a5b2 100644 --- a/CO_storageLinux.c +++ b/CO_storageLinux.c @@ -33,6 +33,7 @@ */ static ODR_t storeLinux(CO_storage_entry_t* entry, CO_CANmodule_t* CANmodule) { + (void)CANmodule; ODR_t ret = ODR_OK; uint16_t crc_store; @@ -61,10 +62,10 @@ storeLinux(CO_storage_entry_t* entry, CO_CANmodule_t* CANmodule) { if (fp == NULL) { ret = ODR_HW; } else { - CO_LOCK_OD(CANmodule); + /* following two lines are subject to race conditions. This function is called only by SDO server + * and so it is already protected by CO_LOCK_OD. */ size_t cnt = fwrite(entry->addr, 1, entry->len, fp); crc_store = crc16_ccitt(entry->addr, entry->len, 0); - CO_UNLOCK_OD(CANmodule); cnt += fwrite(&crc_store, 1, sizeof(crc_store), fp); fclose(fp); if (cnt != (entry->len + sizeof(crc_store))) {