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:
parent
04a0cf7d79
commit
65bb96f37c
1 changed files with 7 additions and 0 deletions
|
@ -78,10 +78,12 @@ int blinfo_lookup(uint16_t key, char *val, int val_len_max)
|
||||||
|
|
||||||
#if defined(CONFIG_RETENTION_BOOTLOADER_INFO_OUTPUT_SETTINGS)
|
#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_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 = {
|
static struct settings_handler blinfo_handler = {
|
||||||
.name = "blinfo",
|
.name = "blinfo",
|
||||||
.h_get = blinfo_handle_get,
|
.h_get = blinfo_handle_get,
|
||||||
|
.h_set = blinfo_handle_set,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int blinfo_handle_get(const char *name, char *val, int val_len_max)
|
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);
|
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
|
#endif
|
||||||
|
|
||||||
static int blinfo_init(void)
|
static int blinfo_init(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue