Skip to content

Commit d15fe4e

Browse files
Manoj Vishwanathananguy11
authored andcommitted
idpf: Acquire the lock before accessing the xn->salt
The transaction salt was being accessed before acquiring the idpf_vc_xn_lock when idpf has to forward the virtchnl reply. Fixes: 34c21fa ("idpf: implement virtchnl transaction manager") Signed-off-by: Manoj Vishwanathan <[email protected]> Signed-off-by: David Decotigny <[email protected]> Signed-off-by: Brian Vazquez <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Reviewed-by: Pavan Kumar Linga <[email protected]> Tested-by: Krishneil Singh <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 137da75 commit d15fe4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/intel/idpf/idpf_virtchnl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,14 +612,15 @@ idpf_vc_xn_forward_reply(struct idpf_adapter *adapter,
612612
return -EINVAL;
613613
}
614614
xn = &adapter->vcxn_mngr->ring[xn_idx];
615+
idpf_vc_xn_lock(xn);
615616
salt = FIELD_GET(IDPF_VC_XN_SALT_M, msg_info);
616617
if (xn->salt != salt) {
617618
dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (%02x != %02x)\n",
618619
xn->salt, salt);
620+
idpf_vc_xn_unlock(xn);
619621
return -EINVAL;
620622
}
621623

622-
idpf_vc_xn_lock(xn);
623624
switch (xn->state) {
624625
case IDPF_VC_XN_WAITING:
625626
/* success */

0 commit comments

Comments
 (0)