[PATCH for master] Really fix the 'bootz' command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>

diff --git a/arch/arm/lib/bootz.c b/arch/arm/lib/bootz.c
index 9be615b..956ea82 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;
 		}

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux