From 59f608d84f937cb5e2fd3a0b9f848f200d47ba85 Mon Sep 17 00:00:00 2001 From: "sjur.brandeland@stericsson.com" Date: Tue, 17 Jan 2012 03:03:14 +0000 Subject: caif: Remove bad WARN_ON in caif_dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove WARN_ON and bad handling of SKB without destructor callback in caif_flow_cb. SKB without destructor cannot be handled as an error case. Signed-off-by: Sjur Brændeland Signed-off-by: David S. Miller --- net/caif/caif_dev.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'net/caif/caif_dev.c') diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index 61570ee76fe6..673728add60b 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/caif_dev.c @@ -146,15 +146,17 @@ void caif_flow_cb(struct sk_buff *skb) spin_lock_bh(&caifd->flow_lock); send_xoff = caifd->xoff; caifd->xoff = 0; - if (!WARN_ON(caifd->xoff_skb_dtor == NULL)) { - WARN_ON(caifd->xoff_skb != skb); - dtor = caifd->xoff_skb_dtor; - caifd->xoff_skb = NULL; - caifd->xoff_skb_dtor = NULL; - } + dtor = caifd->xoff_skb_dtor; + + if (WARN_ON(caifd->xoff_skb != skb)) + skb = NULL; + + caifd->xoff_skb = NULL; + caifd->xoff_skb_dtor = NULL; + spin_unlock_bh(&caifd->flow_lock); - if (dtor) + if (dtor && skb) dtor(skb); if (send_xoff) -- cgit v1.2.3-58-ga151