Re: [PATCH] net: qualcomm: qca_uart: report the consumed byte on RX skb allocation failure
From: Stefan Wahren
Date: Thu Apr 02 2026 - 05:11:48 EST
Am 02.04.26 um 09:12 schrieb Pengpeng Hou:
qca_tty_receive() consumes each input byte before checking whether aReviewed-by: Stefan Wahren <wahrenst@xxxxxxx>
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: dfc768fbe618 ("net: qualcomm: add QCA7000 UART driver")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
Thanks