connector: fix skb double free in cn_rx_skb()
authorPatrick McHardy <kaber@trash.net>
Tue, 12 Apr 2011 05:39:51 +0000 (05:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Apr 2011 21:38:57 +0000 (14:38 -0700)
When a skb is delivered to a registered callback, cn_call_callback()
incorrectly returns -ENODEV after freeing the skb, causing cn_rx_skb()
to free the skb a second time.

Reported-by: Eric B Munson <emunson@mgebm.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Tested-by: Eric B Munson <emunson@mgebm.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/connector/connector.c

index d77005849af857935fe270725f2ee0d08561d265..219d88a0eeae07c1e963c4997f6894fe79046d2a 100644 (file)
@@ -142,6 +142,7 @@ static int cn_call_callback(struct sk_buff *skb)
                cbq->callback(msg, nsp);
                kfree_skb(skb);
                cn_queue_release_callback(cbq);
+               err = 0;
        }
 
        return err;