summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Goodbody <[email protected]>2025-10-02 10:39:58 +0100
committerTom Rini <[email protected]>2025-10-17 18:07:20 -0600
commita58089ad2e41e88f81360f0e99bfd0715aceb556 (patch)
treecc68ba2b267cc7662319915e133db0acf01bd775
parent64a4645c4e4f54d4e67d2954ed20b9e1af389530 (diff)
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 <[email protected]> Reviewed-by: Sean Anderson <[email protected]> Fixes: f676b45151c3 ("fs: Add semihosting filesystem")
-rw-r--r--fs/semihostingfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/semihostingfs.c b/fs/semihostingfs.c
index 77e39ca407e..9d7a136b9ba 100644
--- a/fs/semihostingfs.c
+++ b/fs/semihostingfs.c
@@ -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;
}