Skip to content

Commit

Permalink
NFC: st21nfca: Add error messages for unexpected HCI events
Browse files Browse the repository at this point in the history
Potentially an unexpected HCI event may occur because of a
firmware bug. It could be transparent for the user but we should
at least log it.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
cricard13 authored and Samuel Ortiz committed Oct 27, 2015
1 parent 57dc828 commit a9e062d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/nfc/st21nfca/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,8 @@ static int st21nfca_admin_event_received(struct nfc_hci_dev *hdev, u8 event,
}
}
break;
default:
nfc_err(&hdev->ndev->dev, "Unexpected event on admin gate\n");
}
kfree_skb(skb);
return 0;
Expand Down
1 change: 1 addition & 0 deletions drivers/nfc/st21nfca/dep.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ int st21nfca_dep_event_received(struct nfc_hci_dev *hdev,
return r;
return 0;
default:
nfc_err(&hdev->ndev->dev, "Unexpected event on card f gate\n");
return 1;
}
kfree_skb(skb);
Expand Down
4 changes: 4 additions & 0 deletions drivers/nfc/st21nfca/se.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host,
r = nfc_se_transaction(hdev->ndev, host, transaction);
break;
default:
nfc_err(&hdev->ndev->dev, "Unexpected event on connectivity gate\n");
return 1;
}
kfree_skb(skb);
Expand Down Expand Up @@ -373,6 +374,9 @@ int st21nfca_apdu_reader_event_received(struct nfc_hci_dev *hdev,
mod_timer(&info->se_info.bwi_timer, jiffies +
msecs_to_jiffies(info->se_info.wt_timeout));
break;
default:
nfc_err(&hdev->ndev->dev, "Unexpected event on apdu reader gate\n");
return 1;
}

exit:
Expand Down

0 comments on commit a9e062d

Please sign in to comment.