summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2016-10-17 00:54:03 +0200
committerDavid S. Miller <davem@davemloft.net>2016-10-17 17:24:08 +0200
commit67b11e2ea704f99953f18585609df17b6e189e53 (patch)
tree2aab9bfc0d28b60234e88a8c0233466ce4e34346 /drivers/net/ethernet/chelsio
parentnet: pktgen: remove rcu locking in pktgen_change_name() (diff)
downloadlinux-67b11e2ea704f99953f18585609df17b6e189e53.tar.xz
linux-67b11e2ea704f99953f18585609df17b6e189e53.zip
cxgb4: fix memory leak of qe on error exit path
A memory leak of qe occurs when t4_sched_queue_unbind fails, so fix this by free'ing qe on the error exit path. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/sched.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sched.c b/drivers/net/ethernet/chelsio/cxgb4/sched.c
index 539de764bbd3..cbd68a8fe2e4 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sched.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sched.c
@@ -210,8 +210,10 @@ static int t4_sched_queue_bind(struct port_info *pi, struct ch_sched_queue *p)
/* Unbind queue from any existing class */
err = t4_sched_queue_unbind(pi, p);
- if (err)
+ if (err) {
+ t4_free_mem(qe);
goto out;
+ }
/* Bind queue to specified class */
memset(qe, 0, sizeof(*qe));