diff options
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_net.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c index c6b004182d91..9de177a5b9f1 100644 --- a/drivers/media/dvb/dvb-core/dvb_net.c +++ b/drivers/media/dvb/dvb-core/dvb_net.c | |||
@@ -600,6 +600,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) | |||
600 | /* Check CRC32, we've got it in our skb already. */ | 600 | /* Check CRC32, we've got it in our skb already. */ |
601 | unsigned short ulen = htons(priv->ule_sndu_len); | 601 | unsigned short ulen = htons(priv->ule_sndu_len); |
602 | unsigned short utype = htons(priv->ule_sndu_type); | 602 | unsigned short utype = htons(priv->ule_sndu_type); |
603 | const u8 *tail; | ||
603 | struct kvec iov[3] = { | 604 | struct kvec iov[3] = { |
604 | { &ulen, sizeof ulen }, | 605 | { &ulen, sizeof ulen }, |
605 | { &utype, sizeof utype }, | 606 | { &utype, sizeof utype }, |
@@ -613,10 +614,11 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) | |||
613 | } | 614 | } |
614 | 615 | ||
615 | ule_crc = iov_crc32(ule_crc, iov, 3); | 616 | ule_crc = iov_crc32(ule_crc, iov, 3); |
616 | expected_crc = *((u8 *)priv->ule_skb->tail - 4) << 24 | | 617 | tail = skb_tail_pointer(priv->ule_skb); |
617 | *((u8 *)priv->ule_skb->tail - 3) << 16 | | 618 | expected_crc = *(tail - 4) << 24 | |
618 | *((u8 *)priv->ule_skb->tail - 2) << 8 | | 619 | *(tail - 3) << 16 | |
619 | *((u8 *)priv->ule_skb->tail - 1); | 620 | *(tail - 2) << 8 | |
621 | *(tail - 1); | ||
620 | if (ule_crc != expected_crc) { | 622 | if (ule_crc != expected_crc) { |
621 | printk(KERN_WARNING "%lu: CRC32 check FAILED: %08x / %08x, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n", | 623 | printk(KERN_WARNING "%lu: CRC32 check FAILED: %08x / %08x, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n", |
622 | priv->ts_count, ule_crc, expected_crc, priv->ule_sndu_len, priv->ule_sndu_type, ts_remain, ts_remain > 2 ? *(unsigned short *)from_where : 0); | 624 | priv->ts_count, ule_crc, expected_crc, priv->ule_sndu_len, priv->ule_sndu_type, ts_remain, ts_remain > 2 ? *(unsigned short *)from_where : 0); |