提交 128416ac 编写于 作者: G Ganesh Goudar 提交者: David S. Miller

cxgb4: fix memory leak

do not reuse the loop counter which is used iterate over
the ports, so that sched_tbl will be freed for all the ports.
Signed-off-by: NGanesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1cfe6e93
...@@ -533,10 +533,10 @@ struct sched_table *t4_init_sched(unsigned int sched_size) ...@@ -533,10 +533,10 @@ struct sched_table *t4_init_sched(unsigned int sched_size)
void t4_cleanup_sched(struct adapter *adap) void t4_cleanup_sched(struct adapter *adap)
{ {
struct sched_table *s; struct sched_table *s;
unsigned int i; unsigned int j, i;
for_each_port(adap, i) { for_each_port(adap, j) {
struct port_info *pi = netdev2pinfo(adap->port[i]); struct port_info *pi = netdev2pinfo(adap->port[j]);
s = pi->sched_tbl; s = pi->sched_tbl;
for (i = 0; i < s->sched_size; i++) { for (i = 0; i < s->sched_size; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册