diff options
author | Juergen Beisert <jbe@pengutronix.de> | 2011-10-14 14:37:56 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-10-18 09:17:35 +0200 |
commit | 2b5d8792ac7c95f41f3d5fced553450eea9b40f8 (patch) | |
tree | 6ad7a7994b4b510be0314c6fbf101176323ecb4d | |
parent | c66af9fe057e953a9ed2458e0878cca74a74a521 (diff) | |
download | barebox-2b5d8792ac7c95f41f3d5fced553450eea9b40f8.tar.gz barebox-2b5d8792ac7c95f41f3d5fced553450eea9b40f8.tar.xz |
Really fix the 'bootz' command
Running the 'bootz' command always fails with
could not read <some file>
due to wrong usage of pointers and structures. This is the second try to fix
the 'bootz' command. At least on my target it is now be able again to load a
kernel without any error.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/lib/bootz.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/lib/bootz.c b/arch/arm/lib/bootz.c index 9be615be2a..956ea82862 100644 --- a/arch/arm/lib/bootz.c +++ b/arch/arm/lib/bootz.c @@ -89,10 +89,10 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[]) } } - memcpy(zimage, &header, sizeof(header)); + memcpy(zimage, header, sizeof(*header)); - ret = read(fd, zimage + sizeof(header), end - sizeof(header)); - if (ret < end - sizeof(header)) { + ret = read(fd, zimage + sizeof(*header), end - sizeof(*header)); + if (ret < end - sizeof(*header)) { printf("could not read %s\n", argv[1]); goto err_out1; } |