diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/imx/imx-usb-loader.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c index cbb17cbab9..7e0a110ab4 100644 --- a/scripts/imx/imx-usb-loader.c +++ b/scripts/imx/imx-usb-loader.c @@ -1164,12 +1164,13 @@ static int verify_memory(const void *buf, unsigned len, unsigned addr) int ret, mismatch = 0; void *readbuf; unsigned offset = 0, now; + unsigned alen = ALIGN(len, 4); - readbuf = malloc(len); + readbuf = malloc(alen); if (!readbuf) return -ENOMEM; - ret = read_memory(addr, readbuf, len); + ret = read_memory(addr, readbuf, alen); if (ret < 0) goto err; |