diff options
author | Mandy Lavi <mandy.lavi@freescale.com> | 2015-09-24 14:28:40 (GMT) |
---|---|---|
committer | Mandy Lavi <mandy.lavi@freescale.com> | 2015-11-02 12:46:49 (GMT) |
commit | e82a7610e8e45f51f3490b894cae042be681148f (patch) | |
tree | ecbda6b8ac85383301c3e79cafad4737e2555811 | |
parent | dedb4b3bdc6c4d96fd10ad6b0c30d49b752bcbe6 (diff) | |
download | linux-fsl-qoriq-e82a7610e8e45f51f3490b894cae042be681148f.tar.xz |
fmd: fix locks in ModifyKey function
Fixing an issue that occurs when there are two root ccnodes
and both of them point to the same miss ccnode
Signed-off-by: Mandy Lavi <mandy.lavi@freescale.com>
-rw-r--r-- | drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_cc.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_cc.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_cc.c index f439167..13a5c15 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_cc.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/Pcd/fm_cc.c @@ -6615,7 +6615,6 @@ t_Error FM_PCD_MatchTableModifyKey(t_Handle h_CcNode, uint16_t keyIndex, { t_FmPcd *p_FmPcd; t_FmPcdCcNode *p_CcNode = (t_FmPcdCcNode *)h_CcNode; - t_List h_List; t_Error err = E_OK; SANITY_CHECK_RETURN_ERROR(p_CcNode, E_INVALID_HANDLE); @@ -6624,18 +6623,16 @@ t_Error FM_PCD_MatchTableModifyKey(t_Handle h_CcNode, uint16_t keyIndex, SANITY_CHECK_RETURN_ERROR(p_FmPcd, E_INVALID_HANDLE); SANITY_CHECK_RETURN_ERROR(p_FmPcd->h_Hc, E_INVALID_HANDLE); - INIT_LIST(&h_List); - err = FmPcdCcNodeTreeTryLock(p_FmPcd, p_CcNode, &h_List); - if (err) + if (!FmPcdLockTryLockAll(p_FmPcd)) { - DBG(TRACE, ("Node's trees lock failed")); + DBG(TRACE, ("FmPcdLockTryLockAll failed")); return ERROR_CODE(E_BUSY); } err = FmPcdCcModifyKey(p_FmPcd, p_CcNode, keyIndex, keySize, p_Key, p_Mask); - FmPcdCcNodeTreeReleaseLock(p_FmPcd, &h_List); + FmPcdLockUnlockAll(p_FmPcd); switch(GET_ERROR_TYPE(err) ) { |