Skip to content

Commit

Permalink
staging: nvec: Handle filled up RX buffers
Browse files Browse the repository at this point in the history
If no RX buffer is available in state 1, jump to state
0 again. This will produce an incredible amount of
warnings, but it is not supposed to happen anyway.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Julian Andres Klode authored and Greg Kroah-Hartman committed Sep 30, 2011
1 parent bb0590e commit 8da7986
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/staging/nvec/nvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,11 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
nvec_invalid_flags(nvec, status, true);
} else {
nvec->rx = nvec_msg_alloc(nvec, NVEC_MSG_RX);
/* Should not happen in a normal world */
if (unlikely(nvec->rx == NULL)) {
nvec->state = 0;
break;
}
nvec->rx->data[0] = received;
nvec->rx->pos = 1;
nvec->state = 2;
Expand Down

0 comments on commit 8da7986

Please sign in to comment.