From: Al Viro Date: Wed, 21 May 2008 03:30:51 +0000 (-0300) Subject: V4L/DVB (7958): fix unaligned access in av7110.c X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3e085629bc921c37c1bb2e2fb6227fa14de14682;p=mv-sheeva.git V4L/DVB (7958): fix unaligned access in av7110.c Signed-off-by: Al Viro Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index 747e7f1a626..f05d43d8b5c 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c @@ -51,6 +51,7 @@ #include #include #include +#include #include @@ -1461,9 +1462,9 @@ static int check_firmware(struct av7110* av7110) ptr += 4; /* check dpram file */ - crc = ntohl(*(u32*) ptr); + crc = get_unaligned_be32(ptr); ptr += 4; - len = ntohl(*(u32*) ptr); + len = get_unaligned_be32(ptr); ptr += 4; if (len >= 512) { printk("dvb-ttpci: dpram file is way too big.\n"); @@ -1478,9 +1479,9 @@ static int check_firmware(struct av7110* av7110) ptr += len; /* check root file */ - crc = ntohl(*(u32*) ptr); + crc = get_unaligned_be32(ptr); ptr += 4; - len = ntohl(*(u32*) ptr); + len = get_unaligned_be32(ptr); ptr += 4; if (len <= 200000 || len >= 300000 ||