summaryrefslogtreecommitdiffstats
path: root/net/qrtr
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-04-26 21:00:00 +0200
committerDavid S. Miller <davem@davemloft.net>2021-04-26 21:00:00 +0200
commit6876a18d3361e1893187970e1881a1d88d894d3f (patch)
treec79dfb4843b82d9346cae1dce68d9b1cfece1715 /net/qrtr
parentMerge branch 'bnxt_en-next' (diff)
parentbnxt_en: Fix RX consumer index logic in the error path. (diff)
downloadlinux-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.c8
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;