9
0
Fork 0

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>
This commit is contained in:
Juergen Beisert 2011-10-14 14:37:56 +02:00 committed by Sascha Hauer
parent c66af9fe05
commit 2b5d8792ac
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}