From patchwork Mon Nov 23 09:37:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ang Way Chuang X-Patchwork-Id: 62122 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAN9cP77025842 for ; Mon, 23 Nov 2009 09:38:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756559AbZKWJhw (ORCPT ); Mon, 23 Nov 2009 04:37:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756469AbZKWJhv (ORCPT ); Mon, 23 Nov 2009 04:37:51 -0500 Received: from mail-pz0-f171.google.com ([209.85.222.171]:64889 "EHLO mail-pz0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756422AbZKWJhv (ORCPT ); Mon, 23 Nov 2009 04:37:51 -0500 Received: by pzk1 with SMTP id 1so3831982pzk.33 for ; Mon, 23 Nov 2009 01:37:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=kUFJsL6K4dY2MliXSZyVihvX9L5BP6hq7+GoBkHDfZ4=; b=jAsi03sTCVq/XIySrCiw28tg/qVD9SPMj82Ee76N9ARdkdjqtNHiWVNi92qgYrAyU1 IQ4E+O5UICzvhkBqizXEBnQfBEfVX7qEa5uiNw3zz1U9MRbb7w9GMmjF19qaXWNHt2BC GMMqGw5JcxTYMJQAthn/SQONoQwrqjvN/oHKY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=pBjeL9duWjI7O85MhgiIGA96QDYwZMFvL5DY6yZjrLTU4dFobQtMImguOHqQcAPIY1 rn6A0AJs58KjoOJy32wgmTxLM+PRLMMofc0ofNk3eEiOqSOo6LAZr/Rl5reDh4QpVd64 aneZRm2b495DaFn10p/GwIentlUZNBRDwCErI= MIME-Version: 1.0 Received: by 10.143.25.39 with SMTP id c39mr520849wfj.10.1258969077117; Mon, 23 Nov 2009 01:37:57 -0800 (PST) Date: Mon, 23 Nov 2009 17:37:57 +0800 Message-ID: <51d384e10911230137q7553b8c4x5ba3aca3e8edbc77@mail.gmail.com> Subject: [PATCH] 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 From: Ang Way Chuang To: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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++;