From patchwork Tue Nov 24 01:34:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ang Way Chuang X-Patchwork-Id: 62345 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 nAO1YaaB023600 for ; Tue, 24 Nov 2009 01:34:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757648AbZKXBd7 (ORCPT ); Mon, 23 Nov 2009 20:33:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757594AbZKXBd7 (ORCPT ); Mon, 23 Nov 2009 20:33:59 -0500 Received: from mail-pw0-f42.google.com ([209.85.160.42]:47523 "EHLO mail-pw0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757570AbZKXBd6 convert rfc822-to-8bit (ORCPT ); Mon, 23 Nov 2009 20:33:58 -0500 Received: by pwi3 with SMTP id 3so3812427pwi.21 for ; Mon, 23 Nov 2009 17:34:05 -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 :content-transfer-encoding; bh=ozhgiRLMY019atAzJoLVO71NJ6zI68qRGKAbVaxufXU=; b=lvCiyXdvcef3n7bePqpBRPfD4mmOA+nJWrU/WrozTYoUbQRymrpM7W75DjvIW1ykqL PlOG1Vx1gk66+ZSGy8A+YTOHYknmhfdTypLCljMy9sesTBsJ6aAxEIC62HnvYEdCXkxj 7vBVL++ACRvLrlS/xrdLT8w8OJ26/Y1TRyrfU= 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:content-transfer-encoding; b=hMzpviaptLliIUydbjwdkvkKnhJl9D6PMlZ6dJMLCmf7f4UZkijjusrCXRF26PDlLl 029OUVVpkbIE/Bi55hQjC4suVzrcXQCkGL+518xTweDHzG54n9zFeU3h39jbQkCg6m7D 91WLvX4lQeOXNjhi7EOBq3SSJ5Qg8LpMCVM6g= MIME-Version: 1.0 Received: by 10.142.250.3 with SMTP id x3mr543782wfh.23.1259026444991; Mon, 23 Nov 2009 17:34:04 -0800 (PST) In-Reply-To: <51d384e10911230137q7553b8c4x5ba3aca3e8edbc77@mail.gmail.com> References: <51d384e10911230137q7553b8c4x5ba3aca3e8edbc77@mail.gmail.com> Date: Tue, 24 Nov 2009 09:34:04 +0800 Message-ID: <51d384e10911231734g744d4f6av8b393d99fee92105@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: 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) {