NFC: Added error handling in event_received hci ops

There is no use to return an error if the caller doesn't get it.

Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
Eric Lapuyade 2012-11-28 15:48:44 +01:00 • committed by Samuel Ortiz
commit 27c31191b3
3 changed files with 20 additions and 19 deletions

View file

@ -323,16 +323,18 @@ void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event,
break;
default:
if (hdev->ops->event_received) {
hdev->ops->event_received(hdev, gate, event, skb);
return;
r = hdev->ops->event_received(hdev, gate, event, skb);
goto exit_noskb;
} else {
r = -EINVAL;
}
break;
}
exit:
kfree_skb(skb);
exit_noskb:
if (r) {
/* TODO: There was an error dispatching the event,
* how to propagate up to nfc core?