diff options
author | David S. Miller <davem@davemloft.net> | 2021-04-26 21:00:00 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-26 21:00:00 +0200 |
commit | 6876a18d3361e1893187970e1881a1d88d894d3f (patch) | |
tree | c79dfb4843b82d9346cae1dce68d9b1cfece1715 /net/qrtr | |
parent | Merge branch 'bnxt_en-next' (diff) | |
parent | bnxt_en: Fix RX consumer index logic in the error path. (diff) | |
download | linux-6876a18d3361e1893187970e1881a1d88d894d3f.tar.xz linux-6876a18d3361e1893187970e1881a1d88d894d3f.zip |
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; |