diff options
Diffstat (limited to 'net/nfc/hci/core.c')
-rw-r--r-- | net/nfc/hci/core.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index f30f6fe815b4..0430f3086e41 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c | |||
@@ -297,6 +297,12 @@ void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event, | |||
297 | goto exit; | 297 | goto exit; |
298 | } | 298 | } |
299 | 299 | ||
300 | if (hdev->ops->event_received) { | ||
301 | r = hdev->ops->event_received(hdev, gate, event, skb); | ||
302 | if (r <= 0) | ||
303 | goto exit_noskb; | ||
304 | } | ||
305 | |||
300 | switch (event) { | 306 | switch (event) { |
301 | case NFC_HCI_EVT_TARGET_DISCOVERED: | 307 | case NFC_HCI_EVT_TARGET_DISCOVERED: |
302 | if (skb->len < 1) { /* no status data? */ | 308 | if (skb->len < 1) { /* no status data? */ |
@@ -322,12 +328,8 @@ void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event, | |||
322 | r = nfc_hci_target_discovered(hdev, gate); | 328 | r = nfc_hci_target_discovered(hdev, gate); |
323 | break; | 329 | break; |
324 | default: | 330 | default: |
325 | if (hdev->ops->event_received) { | 331 | pr_info("Discarded unknown event %x to gate %x\n", event, gate); |
326 | r = hdev->ops->event_received(hdev, gate, event, skb); | 332 | r = -EINVAL; |
327 | goto exit_noskb; | ||
328 | } else { | ||
329 | r = -EINVAL; | ||
330 | } | ||
331 | break; | 333 | break; |
332 | } | 334 | } |
333 | 335 | ||