]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - fs/btrfs/hash.c
fs: btrfs: Fix unaligned memory accesses
[people/ms/u-boot.git] / fs / btrfs / hash.c
index f8a50e532aeeb5edabce60b50fbee1fc8b3b4289..cde3abd3dfbb9f25218e6c37b469670d13960d44 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "btrfs.h"
 #include <u-boot/crc.h>
+#include <asm/unaligned.h>
 
 static u32 btrfs_crc32c_table[256];
 
@@ -34,5 +35,5 @@ u32 btrfs_csum_data(char *data, u32 seed, size_t len)
 
 void btrfs_csum_final(u32 crc, void *result)
 {
-       *((u32 *) result) = cpu_to_le32(~crc);
+       put_unaligned(cpu_to_le32(~crc), (u32 *)result);
 }