Skip to content

Commit d086fae

Browse files
etantilovanguy11
authored andcommitted
idpf: improve locking around idpf_vc_xn_push_free()
Protect the set_bit() operation for the free_xn bitmask in idpf_vc_xn_push_free(), to make the locking consistent with rest of the code and avoid potential races in that logic. Fixes: 34c21fa ("idpf: implement virtchnl transaction manager") Cc: stable@vger.kernel.org Reported-by: Ray Zhang <sgzhang@google.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Tested-by: Samuel Salin <Samuel.salin@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 5914781 commit d086fae

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,9 @@ static void idpf_vc_xn_push_free(struct idpf_vc_xn_manager *vcxn_mngr,
402402
struct idpf_vc_xn *xn)
403403
{
404404
idpf_vc_xn_release_bufs(xn);
405+
spin_lock_bh(&vcxn_mngr->xn_bm_lock);
405406
set_bit(xn->idx, vcxn_mngr->free_xn_bm);
407+
spin_unlock_bh(&vcxn_mngr->xn_bm_lock);
406408
}
407409

408410
/**

0 commit comments

Comments
 (0)