summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/lib/hwstub.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hwstub/lib/hwstub.cpp')
-rw-r--r--utils/hwstub/lib/hwstub.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/hwstub/lib/hwstub.cpp b/utils/hwstub/lib/hwstub.cpp
index 7c81146c77..9dd2915903 100644
--- a/utils/hwstub/lib/hwstub.cpp
+++ b/utils/hwstub/lib/hwstub.cpp
@@ -444,7 +444,10 @@ error handle::write(uint32_t addr, const void *buf, size_t& sz, bool atomic)
size_t xfer = std::min(sz, get_buffer_size());
err = write_dev(addr, buf, xfer, atomic);
if(err != error::SUCCESS)
+ {
+ sz = cnt;
return err;
+ }
sz -= xfer;
bufp += xfer;
addr += xfer;