Skip to content

Commit

Permalink
NFC: st21nfcb: Fix memory leak in secure element probing stage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe Ricard authored and Samuel Ortiz committed Apr 5, 2015
1 parent 6be8867 commit 2ca2100
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/nfc/st21nfcb/st21nfcb_se.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2ca2100

Please sign in to comment.