Smatch reported an issue that the wrong variable was being tested after
a call to smh_flen(). Investigating this showed that the API was being
used incorrectly and attempted to return negative errors through an
unsigned return value. This in turn also limited the returns to being
less than 2GB. This series allows the use of file sizes up to 4GB - 2
and also corrects the error detection.

Signed-off-by: Andrew Goodbody <[email protected]>
---
Changes in v4:
- Split out changes to smh_read into separate patch
- Link to v3: 
https://lore.kernel.org/r/[email protected]

Changes in v3:
- V2 missed fixing up one use of smh_flen, fix it
- Link to v2: 
https://lore.kernel.org/r/[email protected]

Changes in v2:
- Fixup smh_flen and smh_read to allow for > 2^31 byte files
- Link to v1: 
https://lore.kernel.org/r/[email protected]

---
Andrew Goodbody (2):
      fs: semihosting: Fixup smh_read against overflow
      fs: semihosting: Fixup smh_flen against overflow

 common/spl/spl_semihosting.c        | 13 +++++++------
 drivers/serial/serial_semihosting.c |  6 ++++--
 fs/semihostingfs.c                  | 23 +++++++++++++----------
 include/semihosting.h               | 13 +++++++------
 lib/semihosting.c                   | 28 ++++++++++++++++++++++------
 5 files changed, 53 insertions(+), 30 deletions(-)
---
base-commit: ecdc3872a767fb045be3296d4317ae978a14b022
change-id: 20251002-fs_semihosting-85d697fbfcad

Best regards,
-- 
Andrew Goodbody <[email protected]>

Reply via email to