NFC: Fix a potential memory leak
authorThierry Escande <thierry.escande@linux.intel.com>
Wed, 5 Jun 2013 15:15:59 +0000 (17:15 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 14 Jun 2013 11:45:06 +0000 (13:45 +0200)
In nfc_llcp_tx_work() the sk_buff is not freed when the llcp_sock
is null and the PDU is an I one.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/llcp_core.c

index 1c4c048e0a1b622cec68c09332bc3f6354e910e8..44730f0edfd861c2d196e887083a71482c1bd8a2 100644 (file)
@@ -719,6 +719,7 @@ static void nfc_llcp_tx_work(struct work_struct *work)
                llcp_sock = nfc_llcp_sock(sk);
 
                if (llcp_sock == NULL && nfc_llcp_ptype(skb) == LLCP_PDU_I) {
+                       kfree_skb(skb);
                        nfc_llcp_send_symm(local->dev);
                } else {
                        struct sk_buff *copy_skb = NULL;