mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-02 09:46:37 +03:00
fs: semihosting: Use correct variable for error check
After calling a function that can return an error, the test to detect
that error should use the return value not a different variable. Fix it.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
Fixes: f676b45151 ("fs: Add semihosting filesystem")
This commit is contained in:
committed by
Tom Rini
parent
64a4645c4e
commit
a58089ad2e
@@ -35,7 +35,7 @@ static int smh_fs_read_at(const char *filename, loff_t pos, void *buffer,
|
||||
}
|
||||
if (!maxsize) {
|
||||
size = smh_flen(fd);
|
||||
if (ret < 0) {
|
||||
if (size < 0) {
|
||||
smh_close(fd);
|
||||
return size;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user