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

Commit 27068eb8 authored by Chris Lew's avatar Chris Lew Committed by Divya Sharma
Browse files

net: qrtr: mhi: Remove timeout and interruptible



Returning early from a send releases the socket reference that sendmsg
takes. This allows that socket to be released and its wq to be freed.
If the MHI ul callback is called after the socket is released, then
there is a chance skb_free for a skb that is attached to that sock will
try to use the wq that is already freed.

Remove the timeout and interruptible modifiers for wait_for_completion
and wait for MHI to call the UL callback before returning to sendmsg.

Change-Id: Icdf41ccf8c1e951855a780dc79a867c5e8cbb387
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent 4f97e2b4
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -116,14 +116,10 @@ static int qcom_mhi_qrtr_send(struct qrtr_endpoint *ep, struct sk_buff *skb)
	if (skb->sk)
		sock_hold(skb->sk);

	rc = wait_for_completion_interruptible_timeout(&pkt->done, HZ * 5);
	if (rc > 0)
		rc = 0;
	else if (rc == 0)
		rc = -ETIMEDOUT;
	wait_for_completion(&pkt->done);

	kref_put(&pkt->refcount, qrtr_mhi_pkt_release);
	return rc;
	return 0;
}

static int qcom_mhi_qrtr_probe(struct mhi_device *mhi_dev,