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:
parent
c66af9fe05
commit
2b5d8792ac
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue