2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 22:24:09 +08:00

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: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ganesh Goudar 2017-09-04 11:16:28 +05:30 committed by David S. Miller
parent 1cfe6e9351
commit 128416acea

View File

@ -533,10 +533,10 @@ struct sched_table *t4_init_sched(unsigned int sched_size)
void t4_cleanup_sched(struct adapter *adap)
{
struct sched_table *s;
unsigned int i;
unsigned int j, i;
for_each_port(adap, i) {
struct port_info *pi = netdev2pinfo(adap->port[i]);
for_each_port(adap, j) {
struct port_info *pi = netdev2pinfo(adap->port[j]);
s = pi->sched_tbl;
for (i = 0; i < s->sched_size; i++) {