msm: mhi-net-dev: Don't over-write skb length

Once the read operation is done, mhi-net driver adds the read data
to the buffer by invoking skb_put() which takes care of updating
the length of skb.

In the existing logic, mhi-net driver is updating skb length thus
skb length is getting incremented twice causing extra (unwanted)
data then read to the client.

Fixing the same by removing the redundant length update logic.

Also move skb_put() ahead of eth_type_trans() as skb length is
being used in eth_type_trans().

Change-Id: I11c420a68f2ad69e8a58f29c620917382ff172f7
Signed-off-by: Veerabhadrarao Badiganti <quic_vbadigan@quicinc.com>
Signed-off-by: Sai Chaitanya Kaveti <quic_skaveti@quicinc.com>
This commit is contained in:
Veerabhadrarao Badiganti 2023-01-10 16:23:31 +05:30 • committed by Sai Chaitanya Kaveti
commit d8d32ae605

View file

@ -238,14 +238,13 @@ static void mhi_dev_net_read_completion_cb(void *req)
struct sk_buff *skb = mreq->context;
unsigned long flags;
skb->len = mreq->transfer_len;
skb_put(skb, mreq->transfer_len);
if (net_handle->eth_iface)
skb->protocol = eth_type_trans(skb, net_handle->dev);
else
skb->protocol = mhi_dev_net_eth_type_trans(skb);
skb_put(skb, mreq->transfer_len);
net_handle->dev->stats.rx_packets++;
skb->dev = net_handle->dev;
netif_rx(skb);