Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (7958): fix unaligned access in av7110.c

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by

Al Viro and committed by
Mauro Carvalho Chehab
3e085629 a230e55d

+5 -4
+5 -4
drivers/media/dvb/ttpci/av7110.c
··· 51 51 #include <linux/crc32.h> 52 52 #include <linux/i2c.h> 53 53 #include <linux/kthread.h> 54 + #include <asm/unaligned.h> 54 55 55 56 #include <asm/system.h> 56 57 ··· 1462 1461 ptr += 4; 1463 1462 1464 1463 /* check dpram file */ 1465 - crc = ntohl(*(u32*) ptr); 1464 + crc = get_unaligned_be32(ptr); 1466 1465 ptr += 4; 1467 - len = ntohl(*(u32*) ptr); 1466 + len = get_unaligned_be32(ptr); 1468 1467 ptr += 4; 1469 1468 if (len >= 512) { 1470 1469 printk("dvb-ttpci: dpram file is way too big.\n"); ··· 1479 1478 ptr += len; 1480 1479 1481 1480 /* check root file */ 1482 - crc = ntohl(*(u32*) ptr); 1481 + crc = get_unaligned_be32(ptr); 1483 1482 ptr += 4; 1484 - len = ntohl(*(u32*) ptr); 1483 + len = get_unaligned_be32(ptr); 1485 1484 ptr += 4; 1486 1485 1487 1486 if (len <= 200000 || len >= 300000 ||