Skip to content

Commit 22d11ea

Browse files
wenwenwang1Jeff Kirsher
authored andcommitted
ixgbe: fix memory leaks
In ixgbe_configure_clsu32(), 'jump', 'input', and 'mask' are allocated through kzalloc() respectively in a for loop body. Then, ixgbe_clsu32_build_input() is invoked to build the input. If this process fails, next iteration of the for loop will be executed. However, the allocated 'jump', 'input', and 'mask' are not deallocated on this execution path, leading to memory leaks. Signed-off-by: Wenwen Wang <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent c160994 commit 22d11ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9490,6 +9490,10 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,
94909490
jump->mat = nexthdr[i].jump;
94919491
adapter->jump_tables[link_uhtid] = jump;
94929492
break;
9493+
} else {
9494+
kfree(mask);
9495+
kfree(input);
9496+
kfree(jump);
94939497
}
94949498
}
94959499
return 0;

0 commit comments

Comments
 (0)