summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio/cxgb4/sched.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2016-10-16 23:54:03 +0100
committerDavid S. Miller <davem@davemloft.net>2016-10-17 11:24:08 -0400
commit67b11e2ea704f99953f18585609df17b6e189e53 (patch)
tree2aab9bfc0d28b60234e88a8c0233466ce4e34346 /drivers/net/ethernet/chelsio/cxgb4/sched.c
parent9a0b1e8ba4061778897b544afc898de2163382f7 (diff)
downloadblackbird-obmc-linux-67b11e2ea704f99953f18585609df17b6e189e53.tar.gz
blackbird-obmc-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/cxgb4/sched.c')
-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));
OpenPOWER on IntegriCloud