diff options
author | Colin Ian King <colin.king@canonical.com> | 2016-10-17 01:54:03 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-10-17 18:24:08 +0300 |
commit | 67b11e2ea704f99953f18585609df17b6e189e53 (patch) | |
tree | 2aab9bfc0d28b60234e88a8c0233466ce4e34346 /drivers/net/ethernet/chelsio/cxgb4/sched.c | |
parent | 9a0b1e8ba4061778897b544afc898de2163382f7 (diff) | |
download | linux-67b11e2ea704f99953f18585609df17b6e189e53.tar.xz |
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.c | 4 |
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)); |