retention: blinfo: Fix issue with crash writing to keys

Fixes an issue which would cause a fault if someone attempted
to write to the (non-writable) blinfo keys

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2023-10-12 07:50:48 +01:00 committed by Fabio Baltieri
commit 65bb96f37c

View file

@ -78,10 +78,12 @@ int blinfo_lookup(uint16_t key, char *val, int val_len_max)
#if defined(CONFIG_RETENTION_BOOTLOADER_INFO_OUTPUT_SETTINGS)
static int blinfo_handle_get(const char *name, char *val, int val_len_max);
static int blinfo_handle_set(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg);
static struct settings_handler blinfo_handler = {
.name = "blinfo",
.h_get = blinfo_handle_get,
.h_set = blinfo_handle_set,
};
static int blinfo_handle_get(const char *name, char *val, int val_len_max)
@ -110,6 +112,11 @@ static int blinfo_handle_get(const char *name, char *val, int val_len_max)
return blinfo_lookup(index, val, val_len_max);
}
static int blinfo_handle_set(const char *name, size_t len, settings_read_cb read_cb, void *cb_arg)
{
return -ENOTSUP;
}
#endif
static int blinfo_init(void)