Commit 67b11e2e authored by Colin Ian King's avatar Colin Ian King Committed by David S. Miller

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: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9a0b1e8b
...@@ -210,8 +210,10 @@ static int t4_sched_queue_bind(struct port_info *pi, struct ch_sched_queue *p) ...@@ -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 */ /* Unbind queue from any existing class */
err = t4_sched_queue_unbind(pi, p); err = t4_sched_queue_unbind(pi, p);
if (err) if (err) {
t4_free_mem(qe);
goto out; goto out;
}
/* Bind queue to specified class */ /* Bind queue to specified class */
memset(qe, 0, sizeof(*qe)); memset(qe, 0, sizeof(*qe));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment