NFC: st21nfcb: Fix memory leak in secure element probing stage
authorChristophe Ricard <christophe.ricard@gmail.com>
Tue, 31 Mar 2015 06:02:14 +0000 (08:02 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 5 Apr 2015 21:54:55 +0000 (23:54 +0200)
In case the hci session is successfully initialized we never
release the nci_core_conn_create dest_params.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/st21nfcb/st21nfcb_se.c

index 7c82e9d87a65d718a92b7066e6b06c3b233e5c60..455b9c2b833dff6e90672a8f8e7f754b7256c747 100644 (file)
@@ -542,14 +542,12 @@ static int st21nfcb_hci_network_init(struct nci_dev *ndev)
 
        r = nci_hci_dev_session_init(ndev);
        if (r != NCI_HCI_ANY_OK)
-               goto exit;
+               goto free_dest_params;
 
        r = nci_nfcee_mode_set(ndev, ndev->hci_dev->conn_info->id,
                               NCI_NFCEE_ENABLE);
        if (r != NCI_STATUS_OK)
-               goto exit;
-
-       return 0;
+               goto free_dest_params;
 
 free_dest_params:
        kfree(dest_params);
This page took 0.033244 seconds and 5 git commands to generate.