summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2022-11-22 22:14:06 -0500
committerTom Rini <[email protected]>2022-11-22 22:14:06 -0500
commit19fb8d7945fcd83828986ac48db74560b26611f9 (patch)
treed65ad8a81d6e62d2786e40186769b48d07280303 /drivers
parent521277ec15eb794229403ec24b8c00a4ff02b0b6 (diff)
parentb4574c0e750bee39cc2448952f127040a37a8e0b (diff)
Merge tag 'dm-pull-22nov22' of https://source.denx.de/u-boot/custodians/u-boot-dm
buildman /binman improvements for handling missing blobs fix for long-standing image.h warning minor fixes
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/emul/sandbox_flash.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/emul/sandbox_flash.c b/drivers/usb/emul/sandbox_flash.c
index 6e8cfe1650a..01ccc4bc178 100644
--- a/drivers/usb/emul/sandbox_flash.c
+++ b/drivers/usb/emul/sandbox_flash.c
@@ -188,15 +188,19 @@ static int handle_ufi_command(struct sandbox_flash_priv *priv, const void *buff,
struct scsi_emul_info *info = &priv->eminfo;
const struct scsi_cmd *req = buff;
int ret;
+ off_t offset;
ret = sb_scsi_emul_command(info, req, len);
if (!ret) {
setup_response(priv);
} else if ((ret == SCSI_EMUL_DO_READ || ret == SCSI_EMUL_DO_WRITE) &&
priv->fd != -1) {
- os_lseek(priv->fd, info->seek_block * info->block_size,
- OS_SEEK_SET);
- setup_response(priv);
+ offset = os_lseek(priv->fd, info->seek_block * info->block_size,
+ OS_SEEK_SET);
+ if (offset == (off_t)-1)
+ setup_fail_response(priv);
+ else
+ setup_response(priv);
} else {
setup_fail_response(priv);
}