diff mbox

dvb-core: Fix ULE decapsulation bug when less than 4 bytes of ULE SNDU is packed into the remaining bytes of a MPEG2-TS frame

Message ID 51d384e10911230137q7553b8c4x5ba3aca3e8edbc77@mail.gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

Ang Way Chuang Nov. 23, 2009, 9:37 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/dvb/dvb-core/dvb_net.c
b/drivers/media/dvb/dvb-core/dvb_net.c
index 0241a7c..7e0db86 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -458,8 +458,9 @@  static void dvb_net_ule( struct net_device *dev,
const u8 *buf, size_t buf_len )
 						       "field: %u.\n", priv->ts_count, *from_where);

 						/* Drop partly decoded SNDU, reset state, resync on PUSI. */
-						if (priv->ule_skb) {
-							dev_kfree_skb( priv->ule_skb );
+						if (priv->ule_skb || priv->ule_sndu_remain) {
+							if (priv->ule_skb)
+								dev_kfree_skb( priv->ule_skb );
 							dev->stats.rx_errors++;
 							dev->stats.rx_frame_errors++;