Clear the RX buffer if message is not deliverable.
If the message received is not deliverable then clear the buffer
to allow other messages to be received.
Change-Id: I204b170e1740c46914e890ec122a038582573e6c
diff --git a/main.c b/main.c
index 63b7039..b838407 100644
--- a/main.c
+++ b/main.c
@@ -277,8 +277,11 @@
int err;
/* Ignore messages that are too small to hold a header. */
- if (len < sizeof(struct hf_msg_hdr))
+ if (len < sizeof(struct hf_msg_hdr)) {
+ pr_err("Message received without header of length %d\n", len);
+ spci_rx_release();
return;
+ }
len -= sizeof(struct hf_msg_hdr);
@@ -295,8 +298,10 @@
rcu_read_unlock();
/* Nothing to do if we couldn't find the target. */
- if (!hsock)
+ if (!hsock) {
+ spci_rx_release();
return;
+ }
/*
* TODO: From this point on, there are two failure paths: when we