diff options
author | Varun Prakash <varun@chelsio.com> | 2017-07-23 10:33:07 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2017-07-30 18:26:00 -0400 |
commit | 66b59f9b1f41ee61eb4862bbcfc1e7db5298ba9e (patch) | |
tree | 812c7fb23ffbe8c3b7d8bdf5ba152cf4f0b82639 | |
parent | ededd039d1b96035b23592c049efcae53922cfce (diff) |
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>
-rw-r--r-- | drivers/target/iscsi/cxgbit/cxgbit_cm.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c index e583dd8a418b..d4fa41be80f9 100644 --- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c +++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c | |||
@@ -1510,11 +1510,13 @@ cxgbit_pass_open_rpl(struct cxgbit_device *cdev, struct sk_buff *skb) | |||
1510 | 1510 | ||
1511 | if (!cnp) { | 1511 | if (!cnp) { |
1512 | pr_info("%s stid %d lookup failure\n", __func__, stid); | 1512 | pr_info("%s stid %d lookup failure\n", __func__, stid); |
1513 | return; | 1513 | goto rel_skb; |
1514 | } | 1514 | } |
1515 | 1515 | ||
1516 | cxgbit_wake_up(&cnp->com.wr_wait, __func__, rpl->status); | 1516 | cxgbit_wake_up(&cnp->com.wr_wait, __func__, rpl->status); |
1517 | cxgbit_put_cnp(cnp); | 1517 | cxgbit_put_cnp(cnp); |
1518 | rel_skb: | ||
1519 | __kfree_skb(skb); | ||
1518 | } | 1520 | } |
1519 | 1521 | ||
1520 | static void | 1522 | static void |
@@ -1530,11 +1532,13 @@ cxgbit_close_listsrv_rpl(struct cxgbit_device *cdev, struct sk_buff *skb) | |||
1530 | 1532 | ||
1531 | if (!cnp) { | 1533 | if (!cnp) { |
1532 | pr_info("%s stid %d lookup failure\n", __func__, stid); | 1534 | pr_info("%s stid %d lookup failure\n", __func__, stid); |
1533 | return; | 1535 | goto rel_skb; |
1534 | } | 1536 | } |
1535 | 1537 | ||
1536 | cxgbit_wake_up(&cnp->com.wr_wait, __func__, rpl->status); | 1538 | cxgbit_wake_up(&cnp->com.wr_wait, __func__, rpl->status); |
1537 | cxgbit_put_cnp(cnp); | 1539 | cxgbit_put_cnp(cnp); |
1540 | rel_skb: | ||
1541 | __kfree_skb(skb); | ||
1538 | } | 1542 | } |
1539 | 1543 | ||
1540 | static void | 1544 | static void |
@@ -1819,12 +1823,16 @@ static void cxgbit_set_tcb_rpl(struct cxgbit_device *cdev, struct sk_buff *skb) | |||
1819 | struct tid_info *t = lldi->tids; | 1823 | struct tid_info *t = lldi->tids; |
1820 | 1824 | ||
1821 | csk = lookup_tid(t, tid); | 1825 | csk = lookup_tid(t, tid); |
1822 | if (unlikely(!csk)) | 1826 | if (unlikely(!csk)) { |
1823 | pr_err("can't find connection for tid %u.\n", tid); | 1827 | pr_err("can't find connection for tid %u.\n", tid); |
1824 | else | 1828 | goto rel_skb; |
1829 | } else { | ||
1825 | cxgbit_wake_up(&csk->com.wr_wait, __func__, rpl->status); | 1830 | cxgbit_wake_up(&csk->com.wr_wait, __func__, rpl->status); |
1831 | } | ||
1826 | 1832 | ||
1827 | cxgbit_put_csk(csk); | 1833 | cxgbit_put_csk(csk); |
1834 | rel_skb: | ||
1835 | __kfree_skb(skb); | ||
1828 | } | 1836 | } |
1829 | 1837 | ||
1830 | static void cxgbit_rx_data(struct cxgbit_device *cdev, struct sk_buff *skb) | 1838 | static void cxgbit_rx_data(struct cxgbit_device *cdev, struct sk_buff *skb) |