diff mbox

[U-Boot,v2,2/3] cramfs: block pointers are 32 bits

Message ID 20170412202917.22045-3-tylerwhall@gmail.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Tyler Hall April 12, 2017, 8:29 p.m. UTC
Using a variably-sized type is incorrect here since we're reading a
fixed file format. Fixes cramfs on 64-bit platforms.

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
---
 fs/cramfs/cramfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini April 19, 2017, 1:02 p.m. UTC | #1
On Wed, Apr 12, 2017 at 04:29:16PM -0400, Tyler Hall wrote:

> Using a variably-sized type is incorrect here since we're reading a
> fixed file format. Fixes cramfs on 64-bit platforms.
> 
> Signed-off-by: Tyler Hall <tylerwhall@gmail.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c
index 05ed27240a..ca8bc5e12b 100644
--- a/fs/cramfs/cramfs.c
+++ b/fs/cramfs/cramfs.c
@@ -162,7 +162,7 @@  static int cramfs_uncompress (unsigned long begin, unsigned long offset,
 			      unsigned long loadoffset)
 {
 	struct cramfs_inode *inode = (struct cramfs_inode *) (begin + offset);
-	unsigned long *block_ptrs = (unsigned long *)
+	u32 *block_ptrs = (u32 *)
 		(begin + (CRAMFS_GET_OFFSET (inode) << 2));
 	unsigned long curr_block = (CRAMFS_GET_OFFSET (inode) +
 				    (((CRAMFS_24 (inode->size)) +