Skip to content

Commit 7b55c2e

Browse files
manank20davem330
authored andcommitted
ethernet: marvell: octeontx2 Fix resource not freed after malloc
fix rxsc and txsc not getting freed before going out of scope Fixes: c54ffc7 ("octeontx2-pf: mcs: Introduce MACSEC hardware offloading") Signed-off-by: Manank Patel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent aa1d7e1 commit 7b55c2e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/cn10k_macsec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,7 @@ static struct cn10k_mcs_txsc *cn10k_mcs_create_txsc(struct otx2_nic *pfvf)
815815
cn10k_mcs_free_rsrc(pfvf, MCS_TX, MCS_RSRC_TYPE_FLOWID,
816816
txsc->hw_flow_id, false);
817817
fail:
818+
kfree(txsc);
818819
return ERR_PTR(ret);
819820
}
820821

@@ -870,6 +871,7 @@ static struct cn10k_mcs_rxsc *cn10k_mcs_create_rxsc(struct otx2_nic *pfvf)
870871
cn10k_mcs_free_rsrc(pfvf, MCS_RX, MCS_RSRC_TYPE_FLOWID,
871872
rxsc->hw_flow_id, false);
872873
fail:
874+
kfree(rxsc);
873875
return ERR_PTR(ret);
874876
}
875877

0 commit comments

Comments
 (0)