All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Townsend <martin.townsend@xsilon.com>
To: Alexander Aring <alex.aring@gmail.com>
Cc: linux-wpan@vger.kernel.org
Subject: skb free patches
Date: Tue, 28 Oct 2014 21:43:55 +0000	[thread overview]
Message-ID: <54500E1B.20805@xsilon.com> (raw)

Hi Alex,

I've prepared the patches for freeing skb outside of the decompress 
routines but now I'm unsure whether this is the best thing to do.

Plus side
it makes the decompression routine neater, no goto's, just return an 
error code.
Centralises the freeing of the skb.
Easier to maintain, future decompression routines don't have to worry 
about making sure all error paths have freed the skb.

Negative side
Decompression routines musn't reallocate the skb, ie make a copy. The 
skb pointer that is passed in must still be valid on return otherwise we 
get a double free.  I think skb_cow is ok as it calls pskb_expand_head 
which just makes more room in the data but if a routine was to use 
skb_copy then I think we would be in trouble.

Maybe decompression routines should only be using routines like skb_cow 
as they are more effecient.  What are your thoughts before I send the 
series?


- Martin.

             reply	other threads:[~2014-10-28 21:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-28 21:43 Martin Townsend [this message]
     [not found] ` <5458D90B.70206@xsilon.com>
2014-11-04 14:19   ` skb free patches Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54500E1B.20805@xsilon.com \
    --to=martin.townsend@xsilon.com \
    --cc=alex.aring@gmail.com \
    --cc=linux-wpan@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.