Return-Path: Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: [PATCHv2 bluetooth-next] 6lowpan: move skb_free from error paths in decompression From: Marcel Holtmann In-Reply-To: <1415301313-32290-1-git-send-email-mtownsend1973@gmail.com> Date: Thu, 6 Nov 2014 13:11:23 -0800 Cc: linux-wpan@vger.kernel.org, linux-bluetooth@vger.kernel.org, alex.aring@gmail.com, jukka.rissanen@linux.intel.com Message-Id: <930045C7-036D-41C9-B877-3BB126AB55E5@holtmann.org> References: <1415301313-32290-1-git-send-email-mtownsend1973@gmail.com> To: Martin Townsend Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Martin, > Currently we ensure that the skb is freed on every error path in IPHC > decompression which makes it easy to introduce skb leaks. By centralising > the skb_free into the receive function it makes future decompression routines > easier to maintain. It does come at the expense of ensuring that the skb > passed into the decompression routine must not be copied. > > Signed-off-by: Martin Townsend > --- > net/6lowpan/iphc.c | 31 ++++++++++++------------------- > net/bluetooth/6lowpan.c | 15 +++++++-------- > net/ieee802154/6lowpan_rtnl.c | 16 ++++++---------- > 3 files changed, 25 insertions(+), 37 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel