Commit 210ceb4f authored by Julian Andres Klode's avatar Julian Andres Klode Committed by Greg Kroah-Hartman

staging: nvec: Reject incomplete messages

Reject incomplete messages, causing the request to be
transmitted again. This should fix various problems
out there.
Signed-off-by: default avatarJulian Andres Klode <jak@jak-linux.org>
Acked-by: default avatarMarc Dietrich <marvin24@gmx.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8da79863
...@@ -439,11 +439,16 @@ static void nvec_tx_completed(struct nvec_chip *nvec) ...@@ -439,11 +439,16 @@ static void nvec_tx_completed(struct nvec_chip *nvec)
*/ */
static void nvec_rx_completed(struct nvec_chip *nvec) static void nvec_rx_completed(struct nvec_chip *nvec)
{ {
if (nvec->rx->pos != nvec_msg_size(nvec->rx)) if (nvec->rx->pos != nvec_msg_size(nvec->rx)) {
dev_err(nvec->dev, "RX incomplete: Expected %u bytes, got %u\n", dev_err(nvec->dev, "RX incomplete: Expected %u bytes, got %u\n",
(uint) nvec_msg_size(nvec->rx), (uint) nvec_msg_size(nvec->rx),
(uint) nvec->rx->pos); (uint) nvec->rx->pos);
nvec_msg_free(nvec, nvec->rx);
nvec->state = 0;
return;
}
spin_lock(&nvec->rx_lock); spin_lock(&nvec->rx_lock);
/* add the received data to the work list /* add the received data to the work list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment