NFC: st-nci: Fix host_list verification after SE activation
A secure element can be activated in different order. The host_list is updated keeping a fixed order: <terminal_host_id><uicc_id><ese_id>. Cc: stable@vger.kernel.org Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
06521053a0
commit
4e932acc6f
1 changed files with 5 additions and 2 deletions
|
@ -423,7 +423,7 @@ static int st_nci_control_se(struct nci_dev *ndev, u8 se_idx,
|
||||||
u8 state)
|
u8 state)
|
||||||
{
|
{
|
||||||
struct st_nci_info *info = nci_get_drvdata(ndev);
|
struct st_nci_info *info = nci_get_drvdata(ndev);
|
||||||
int r;
|
int r, i;
|
||||||
struct sk_buff *sk_host_list;
|
struct sk_buff *sk_host_list;
|
||||||
u8 host_id;
|
u8 host_id;
|
||||||
|
|
||||||
|
@ -470,7 +470,10 @@ static int st_nci_control_se(struct nci_dev *ndev, u8 se_idx,
|
||||||
if (r != NCI_HCI_ANY_OK)
|
if (r != NCI_HCI_ANY_OK)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
host_id = sk_host_list->data[sk_host_list->len - 1];
|
for (i = 0; i < sk_host_list->len &&
|
||||||
|
sk_host_list->data[i] != se_idx; i++)
|
||||||
|
;
|
||||||
|
host_id = sk_host_list->data[i];
|
||||||
kfree_skb(sk_host_list);
|
kfree_skb(sk_host_list);
|
||||||
if (state == ST_NCI_SE_MODE_ON && host_id == se_idx)
|
if (state == ST_NCI_SE_MODE_ON && host_id == se_idx)
|
||||||
return se_idx;
|
return se_idx;
|
||||||
|
|
Loading…
Add table
Reference in a new issue