Skip to content

Commit b76254c

Browse files
neosys007kuba-moo
authored andcommitted
net: qualcomm: qca_uart: report the consumed byte on RX skb allocation failure
qca_tty_receive() consumes each input byte before checking whether a completed frame needs a fresh receive skb. When the current byte completes a frame, the driver delivers that frame and then allocates a new skb for the next one. If that allocation fails, the current code returns i even though data[i] has already been consumed and may already have completed the delivered frame. Since serdev interprets the return value as the number of accepted bytes, this under-reports progress by one byte and can replay the final byte of the completed frame into a fresh parser state on the next call. Return i + 1 in that failure path so the accepted-byte count matches the actual receive-state progress. Fixes: dfc768f ("net: qualcomm: add QCA7000 UART driver") Cc: [email protected] Signed-off-by: Pengpeng Hou <[email protected]> Reviewed-by: Stefan Wahren <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 48a5fe3 commit b76254c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/qualcomm/qca_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ qca_tty_receive(struct serdev_device *serdev, const u8 *data, size_t count)
100100
if (!qca->rx_skb) {
101101
netdev_dbg(netdev, "recv: out of RX resources\n");
102102
n_stats->rx_errors++;
103-
return i;
103+
return i + 1;
104104
}
105105
}
106106
}

0 commit comments

Comments
 (0)