diff options
author | David S. Miller <davem@davemloft.net> | 2021-04-26 12:00:00 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-26 12:00:00 -0700 |
commit | 6876a18d3361e1893187970e1881a1d88d894d3f (patch) | |
tree | c79dfb4843b82d9346cae1dce68d9b1cfece1715 /net/qrtr | |
parent | 0ea1041bfa3aa2971f858edd9e05477c2d3d54a0 (diff) | |
parent | bbd6f0a948139970f4a615dff189d9a503681a39 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Diffstat (limited to 'net/qrtr')
-rw-r--r-- | net/qrtr/mhi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/qrtr/mhi.c b/net/qrtr/mhi.c index 2bf2b1943e61..fa611678af05 100644 --- a/net/qrtr/mhi.c +++ b/net/qrtr/mhi.c @@ -50,6 +50,9 @@ static int qcom_mhi_qrtr_send(struct qrtr_endpoint *ep, struct sk_buff *skb) struct qrtr_mhi_dev *qdev = container_of(ep, struct qrtr_mhi_dev, ep); int rc; + if (skb->sk) + sock_hold(skb->sk); + rc = skb_linearize(skb); if (rc) goto free_skb; @@ -59,12 +62,11 @@ static int qcom_mhi_qrtr_send(struct qrtr_endpoint *ep, struct sk_buff *skb) if (rc) goto free_skb; - if (skb->sk) - sock_hold(skb->sk); - return rc; free_skb: + if (skb->sk) + sock_put(skb->sk); kfree_skb(skb); return rc; |