mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
cxgbit: add missing __kfree_skb()
Call __kfree_skb() after processing skb to avoid memory leak. Signed-off-by: Varun Prakash <varun@chelsio.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
parent
ededd039d1
commit
66b59f9b1f
1 changed files with 12 additions and 4 deletions
|
@ -1510,11 +1510,13 @@ cxgbit_pass_open_rpl(struct cxgbit_device *cdev, struct sk_buff *skb)
|
||||||
|
|
||||||
if (!cnp) {
|
if (!cnp) {
|
||||||
pr_info("%s stid %d lookup failure\n", __func__, stid);
|
pr_info("%s stid %d lookup failure\n", __func__, stid);
|
||||||
return;
|
goto rel_skb;
|
||||||
}
|
}
|
||||||
|
|
||||||
cxgbit_wake_up(&cnp->com.wr_wait, __func__, rpl->status);
|
cxgbit_wake_up(&cnp->com.wr_wait, __func__, rpl->status);
|
||||||
cxgbit_put_cnp(cnp);
|
cxgbit_put_cnp(cnp);
|
||||||
|
rel_skb:
|
||||||
|
__kfree_skb(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1530,11 +1532,13 @@ cxgbit_close_listsrv_rpl(struct cxgbit_device *cdev, struct sk_buff *skb)
|
||||||
|
|
||||||
if (!cnp) {
|
if (!cnp) {
|
||||||
pr_info("%s stid %d lookup failure\n", __func__, stid);
|
pr_info("%s stid %d lookup failure\n", __func__, stid);
|
||||||
return;
|
goto rel_skb;
|
||||||
}
|
}
|
||||||
|
|
||||||
cxgbit_wake_up(&cnp->com.wr_wait, __func__, rpl->status);
|
cxgbit_wake_up(&cnp->com.wr_wait, __func__, rpl->status);
|
||||||
cxgbit_put_cnp(cnp);
|
cxgbit_put_cnp(cnp);
|
||||||
|
rel_skb:
|
||||||
|
__kfree_skb(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1819,12 +1823,16 @@ static void cxgbit_set_tcb_rpl(struct cxgbit_device *cdev, struct sk_buff *skb)
|
||||||
struct tid_info *t = lldi->tids;
|
struct tid_info *t = lldi->tids;
|
||||||
|
|
||||||
csk = lookup_tid(t, tid);
|
csk = lookup_tid(t, tid);
|
||||||
if (unlikely(!csk))
|
if (unlikely(!csk)) {
|
||||||
pr_err("can't find connection for tid %u.\n", tid);
|
pr_err("can't find connection for tid %u.\n", tid);
|
||||||
else
|
goto rel_skb;
|
||||||
|
} else {
|
||||||
cxgbit_wake_up(&csk->com.wr_wait, __func__, rpl->status);
|
cxgbit_wake_up(&csk->com.wr_wait, __func__, rpl->status);
|
||||||
|
}
|
||||||
|
|
||||||
cxgbit_put_csk(csk);
|
cxgbit_put_csk(csk);
|
||||||
|
rel_skb:
|
||||||
|
__kfree_skb(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cxgbit_rx_data(struct cxgbit_device *cdev, struct sk_buff *skb)
|
static void cxgbit_rx_data(struct cxgbit_device *cdev, struct sk_buff *skb)
|
||||||
|
|
Loading…
Reference in a new issue