Commit e038e67f authored by Ivan Safonov's avatar Ivan Safonov Committed by Greg Kroah-Hartman

staging:r8188eu: update pkt->(data|tail|len) synchronously with...

staging:r8188eu: update pkt->(data|tail|len) synchronously with rx_(data|tail|len) in recv_frame structure

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: default avatarIvan Safonov <insafonov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bdf299c1
......@@ -261,6 +261,8 @@ static inline u8 *recvframe_pull(struct recv_frame *precvframe, int sz)
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;
......@@ -278,7 +280,7 @@ static inline u8 *recvframe_put(struct recv_frame *precvframe, int sz)
if (precvframe == NULL)
return NULL;
skb_put(precvframe->pkt, sz);
precvframe->rx_tail += sz;
if (precvframe->rx_tail > precvframe->pkt->end) {
......@@ -299,6 +301,7 @@ static inline u8 *recvframe_pull_tail(struct recv_frame *precvframe, int sz)
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;
......
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