Skip to content
Commit 440de0dd authored by Yonas Alizadeh's avatar Yonas Alizadeh Committed by Benjamin Cabé
Browse files

fs: nvs: fix invalid block compare when data CRC is enabled



When nvs_write is called, the nvs_flash_block_cmp is used to check if
the new data to be written matches the data already on flash. This check
always fail when CONFIG_NVS_DATA_CRC is enabled, caused by the
NVS_DATA_CRC_SIZE being added to the len parameter. The pointer to the
new data does not already have the CRC part added, while the data on
flash does, and the size to be compared includes CRC section.
By removing the addition of NVS_DATA_CRC_SIZE to the compare size, only
the data without CRC is compared, which will make the compare work in
both cases.

Signed-off-by: default avatarYonas Alizadeh <yonas.alizadeh@alfalaval.com>
parent 691816d2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment