From 4a2fbe421e9ea8f6198b18d2991f81f0bdf1b9b9 Mon Sep 17 00:00:00 2001 From: mtaylor Date: Sun, 25 Nov 2007 07:39:48 +0000 Subject: [PATCH] Only install debug destructor if destructor is not already used by the kernel, otherwise we can interfere with normal cleanup. git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2955 0192ed92-7a03-0410-a25b-9323aeb14dbd --- net80211/ieee80211_skb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net80211/ieee80211_skb.c b/net80211/ieee80211_skb.c index 5a356c1..b518e01 100644 --- a/net80211/ieee80211_skb.c +++ b/net80211/ieee80211_skb.c @@ -293,8 +293,10 @@ track_skb(struct sk_buff *skb, int users_adjustment, print_skb_trackchange_message(skb, users_adjustment, func1, line1, func2, line2, " is now ** TRACKED **"); - /* Always use our debug destructor */ - skb->destructor = skb_destructor; + /* Always use our debug destructor, when we can... */ + if (NULL == skb->destructor) { + skb->destructor = skb_destructor; + } return skb; } @@ -328,7 +330,6 @@ untrack_skb(struct sk_buff *skb, int users_adjustment, print_skb_trackchange_message(skb, users_adjustment, func1, line1, func2, line2, " is now ** UNTRACKED **"); - skb->destructor = skb_destructor; return skb; } @@ -484,6 +485,7 @@ void ieee80211_dev_kfree_skb(struct sk_buff** pskb) #endif } } + /* Decrement the ref count for the skb, possibly freeing the memory */ #ifdef IEEE80211_DEBUG_REFCNT unref_skb(skb, UNREF_USE_DEV_KFREE_SKB_ANY,