Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 786616e3 authored by Karthikeyan Ramasubramanian's avatar Karthikeyan Ramasubramanian
Browse files

drivers: qcom: ipc: Initialize the RX SKB header appropriately



The header of the RX Socket buffers(SKBs) is initialized with the maximum
receiveable packet size. When the concerned SKB gets forwarded to another
transport, it leads to passing incorrect packet length and a potential
stall of that IPC Router transport.

Receive the incoming data in the SKB and then initialize the SKB header
with the appropriate packet information.

Change-Id: Ia150e4b3498a481af4a2dacf7d02e9e90a9f935e
Signed-off-by: default avatarKarthikeyan Ramasubramanian <kramasub@codeaurora.org>
parent ec4b001e
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -296,7 +296,6 @@ static void hsic_xprt_read_data(struct work_struct *work)
{
	int pkt_size;
	struct sk_buff *skb = NULL;
	void *data;
	struct ipc_bridge_platform_data *pdata;
	struct delayed_work *rwork = to_delayed_work(work);
	struct msm_ipc_router_hsic_xprt *hsic_xprtp =
@@ -338,8 +337,7 @@ static void hsic_xprt_read_data(struct work_struct *work)
			pr_err("%s: Couldn't alloc SKB\n", __func__);
			msleep(100);
		}
		data = skb_put(skb, pdata->max_read_size);
		pkt_size = pdata->read(hsic_xprtp->pdev, data,
		pkt_size = pdata->read(hsic_xprtp->pdev, skb->data,
					pdata->max_read_size);
		if (pkt_size < 0) {
			pr_err("%s: Error %d @ read operation\n",
@@ -349,6 +347,7 @@ static void hsic_xprt_read_data(struct work_struct *work)
			kfree(hsic_xprtp->in_pkt);
			break;
		}
		skb_put(skb, pkt_size);
		skb_queue_tail(hsic_xprtp->in_pkt->pkt_fragment_q, skb);
		hsic_xprtp->in_pkt->length = pkt_size;
		D("%s: Packet size read %d\n", __func__, pkt_size);