From 65bb96f37c6a45b923fd53c19df855fa1dc7c5a9 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 12 Oct 2023 07:50:48 +0100 Subject: [PATCH] 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 --- subsys/retention/blinfo_mcuboot.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subsys/retention/blinfo_mcuboot.c b/subsys/retention/blinfo_mcuboot.c index 35845dee712..8c4ccaaa674 100644 --- a/subsys/retention/blinfo_mcuboot.c +++ b/subsys/retention/blinfo_mcuboot.c @@ -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)