diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2023-12-12 18:33:27 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-01-05 15:41:47 -0500 |
commit | f29c5ca33df4c77b9af2cbfb7ed90bf336613522 (patch) | |
tree | dbf79dc9ccf7f613b8bb0c01fb7ca93e0d11e2b6 /lib/net_utils.c | |
parent | 0d53be75c701d00ea3a106db1f3e5cca8c05068f (diff) |
fw_env: fix reading NVMEM device's "compatible" value
Call to fread() was changed to check for return value. The problem is it
can't be checked for returning 1 (as it is) to determine success.
We call fread() with buffer size as "size" argument. Reading any
"compatible" value shorter than buffer size will result in returning 0
even on success.
Modify code to use fstat() to determine expected read length.
This fixes regression that broke using fw_env with NVMEM devices.
Fixes: c059a22b7776 ("tools: env: fw_env: Fix unused-result warning")
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'lib/net_utils.c')
0 files changed, 0 insertions, 0 deletions