NFC: digital: Free supervisor PDUs
authorThierry Escande <thierry.escande@collabora.com>
Fri, 8 Jul 2016 13:52:44 +0000 (15:52 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 11 Jul 2016 00:00:26 +0000 (02:00 +0200)
This patch frees the RTOX resp sk_buff in initiator mode. It also makes
use of the free_resp exit point for ATN supervisor PDUs in both
initiator and target mode.

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

index 03bfc74745f7192b87deb85f8a1a10523d38a460..ba52a5dbf3ccb33fe4ef24e7e5c670b4d3ddd03c 100644 (file)
@@ -823,15 +823,14 @@ static void digital_in_recv_dep_res(struct nfc_digital_dev *ddev, void *arg,
                        if (rc)
                                goto error;
 
-                       return;
+                       goto free_resp;
                }
 
                rc = digital_in_send_rtox(ddev, data_exch, resp->data[0]);
                if (rc)
                        goto error;
 
-               kfree_skb(resp);
-               return;
+               goto free_resp;
        }
 
 exit:
@@ -1225,8 +1224,7 @@ static void digital_tg_recv_dep_req(struct nfc_digital_dev *ddev, void *arg,
 
                ddev->atn_count++;
 
-               kfree_skb(resp);
-               return;
+               goto free_resp;
        }
 
        rc = nfc_tm_data_received(ddev->nfc_dev, resp);