Original driver code uses rx_* members to store skb (pkt) fields
(instead of pkt->* members), pkt->* updated only after data
completely formed, not in process.
Update pkt->* after data buffer changed (with rx_*).
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (precvframe == NULL)
return NULL;
+
+ skb_pull(precvframe->pkt, sz);
precvframe->rx_data += sz;
if (precvframe->rx_data > precvframe->rx_tail) {
precvframe->rx_data -= sz;
if (precvframe == NULL)
return NULL;
-
+ skb_put(precvframe->pkt, sz);
precvframe->rx_tail += sz;
if (precvframe->rx_tail > precvframe->pkt->end) {
if (precvframe == NULL)
return NULL;
+ skb_trim(precvframe->pkt, precvframe->pkt->len - sz);
precvframe->rx_tail -= sz;
if (precvframe->rx_tail < precvframe->rx_data) {
precvframe->rx_tail += sz;