diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2008-05-20 23:30:51 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-06-05 05:35:48 -0400 |
commit | 3e085629bc921c37c1bb2e2fb6227fa14de14682 (patch) | |
tree | f765e435d7e8375dfb3be3e0d450271d874bbe4c /drivers/media/dvb/ttpci/av7110.c | |
parent | a230e55d92347e09d9ba2e97096df114b2dfaf2d (diff) |
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>
Diffstat (limited to 'drivers/media/dvb/ttpci/av7110.c')
-rw-r--r-- | drivers/media/dvb/ttpci/av7110.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index 747e7f1a6267..f05d43d8b5cf 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #include <linux/crc32.h> | 51 | #include <linux/crc32.h> |
52 | #include <linux/i2c.h> | 52 | #include <linux/i2c.h> |
53 | #include <linux/kthread.h> | 53 | #include <linux/kthread.h> |
54 | #include <asm/unaligned.h> | ||
54 | 55 | ||
55 | #include <asm/system.h> | 56 | #include <asm/system.h> |
56 | 57 | ||
@@ -1461,9 +1462,9 @@ static int check_firmware(struct av7110* av7110) | |||
1461 | ptr += 4; | 1462 | ptr += 4; |
1462 | 1463 | ||
1463 | /* check dpram file */ | 1464 | /* check dpram file */ |
1464 | crc = ntohl(*(u32*) ptr); | 1465 | crc = get_unaligned_be32(ptr); |
1465 | ptr += 4; | 1466 | ptr += 4; |
1466 | len = ntohl(*(u32*) ptr); | 1467 | len = get_unaligned_be32(ptr); |
1467 | ptr += 4; | 1468 | ptr += 4; |
1468 | if (len >= 512) { | 1469 | if (len >= 512) { |
1469 | printk("dvb-ttpci: dpram file is way too big.\n"); | 1470 | printk("dvb-ttpci: dpram file is way too big.\n"); |
@@ -1478,9 +1479,9 @@ static int check_firmware(struct av7110* av7110) | |||
1478 | ptr += len; | 1479 | ptr += len; |
1479 | 1480 | ||
1480 | /* check root file */ | 1481 | /* check root file */ |
1481 | crc = ntohl(*(u32*) ptr); | 1482 | crc = get_unaligned_be32(ptr); |
1482 | ptr += 4; | 1483 | ptr += 4; |
1483 | len = ntohl(*(u32*) ptr); | 1484 | len = get_unaligned_be32(ptr); |
1484 | ptr += 4; | 1485 | ptr += 4; |
1485 | 1486 | ||
1486 | if (len <= 200000 || len >= 300000 || | 1487 | if (len <= 200000 || len >= 300000 || |