Skip to content
Commit f29c5ca3 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by Tom Rini
Browse files

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: c059a22b ("tools: env: fw_env: Fix unused-result warning")
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
parent 0d53be75
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment