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 <manojvishy@google.com> Signed-off-by: David Decotigny <decot@google.com> Signed-off-by: Brian Vazquez <brianvv@google.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 137da75 commit d15fe4e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)