mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 12:08:36 +08:00
driver/mtd_config_fs: just query when data is null or len is zero
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
This commit is contained in:
parent
4cba6630fb
commit
da9b05cc33
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue