You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/08/07 12:46:03 UTC
[nuttx] 01/02: driver/mtd_config_fs: just query when data is null or len is zero
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit da9b05cc33e5e758dbc90ab8afa652c498b92671
Author: xucheng5 <xu...@xiaomi.com>
AuthorDate: Wed Jul 12 15:08:51 2023 +0800
driver/mtd_config_fs: just query when data is null or len is zero
Signed-off-by: xucheng5 <xu...@xiaomi.com>
---
drivers/mtd/mtd_config_fs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/mtd_config_fs.c b/drivers/mtd/mtd_config_fs.c
index 0267d2a149..2d7c406065 100644
--- a/drivers/mtd/mtd_config_fs.c
+++ b/drivers/mtd/mtd_config_fs.c
@@ -1412,7 +1412,7 @@ static ssize_t nvs_read_entry(FAR struct nvs_fs *fs, FAR const uint8_t *key,
}
while (true);
- if (data)
+ if (data && len)
{
rd_addr &= ADDR_BLOCK_MASK;
rd_addr += wlk_ate.offset + wlk_ate.key_len;
@@ -1750,7 +1750,7 @@ static ssize_t nvs_read(FAR struct nvs_fs *fs,
uint8_t key[sizeof(pdata->id) + sizeof(pdata->instance)];
#endif
- if (pdata == NULL || pdata->len == 0 || pdata->configdata == NULL)
+ if (pdata == NULL)
{
return -EINVAL;
}