From patchwork Tue Nov 24 08:04:41 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: 62399 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 nAO85NY5007702 for ; Tue, 24 Nov 2009 08:05:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932077AbZKXIEg (ORCPT ); Tue, 24 Nov 2009 03:04:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755118AbZKXIEg (ORCPT ); Tue, 24 Nov 2009 03:04:36 -0500 Received: from mail-px0-f180.google.com ([209.85.216.180]:65520 "EHLO mail-px0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753920AbZKXIEf (ORCPT ); Tue, 24 Nov 2009 03:04:35 -0500 Received: by pxi10 with SMTP id 10so4752848pxi.33 for ; Tue, 24 Nov 2009 00:04:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=jXtkMBXbsnzSG8JPIZmiKQoQ88iu13WS/kKLYSe6yCo=; b=I3JiX6diGLbpzgvf1zF/iWVYgthNyMYYI5PNLGAKZAdkrv8Aauq5ga8PVXcxxy28z/ BuS8QlO6TGlHR8+ahJDcVDyI7XFSMLXLs9JS1701IFv9mngAsvz2q0eKhsAXfCIYEUBq z5ZgspFUTt4KHzK99u91b5ubuBt/8IMdqX1EM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=BMRnPy9NNAY5MAT79/hgaS+W5kBFZI5LxEiKS5r66ZzmYD0N2627j2DcNipZzdQG4H JlYsWiaHFKwsvTXlqrIO2r6sEZY4jE3CgqI7K5HYe/i1vaWuStNgCsFor2ghBYBnWOqY I/PzPPw/SbxgM47EV6uaciniiweyZlD2mVvNE= MIME-Version: 1.0 Received: by 10.142.8.8 with SMTP id 8mr672052wfh.64.1259049881256; Tue, 24 Nov 2009 00:04:41 -0800 (PST) In-Reply-To: <20091124080006.GB14488@bicker> References: <51d384e10911230137q7553b8c4x5ba3aca3e8edbc77@mail.gmail.com> <20091124080006.GB14488@bicker> Date: Tue, 24 Nov 2009 16:04:41 +0800 Message-ID: <51d384e10911240004t47bb3d18g4e95e52d83b99e06@mail.gmail.com> Subject: Re: [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: Dan Carpenter , Ang Way Chuang , 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++;