Skip to content

Commit c89ebb9

Browse files
Colin Ian KingJeff Kirsher
authored andcommitted
ixgbe: fix memory leak on ipsec allocation
The error clean up path kfree's adapter->ipsec and should be instead kfree'ing ipsec. Fix this. Also, the err1 error exit path does not need to kfree ipsec because this failure path was for the failed allocation of ipsec. Detected by CoverityScan, CID#146424 ("Resource Leak") Fixes: 63a67fe ("ixgbe: add ipsec offload add and remove SA") Signed-off-by: Colin Ian King <[email protected]> Acked-by: Shannon Nelson <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent cf12aab commit c89ebb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,8 @@ void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter)
943943
kfree(ipsec->ip_tbl);
944944
kfree(ipsec->rx_tbl);
945945
kfree(ipsec->tx_tbl);
946+
kfree(ipsec);
946947
err1:
947-
kfree(adapter->ipsec);
948948
netdev_err(adapter->netdev, "Unable to allocate memory for SA tables");
949949
}
950950

0 commit comments

Comments
 (0)