Skip to content
Commit b078ee3f authored by Alex Williamson's avatar Alex Williamson Committed by bgman111111
Browse files

vfio/pci: Clear token on bypass registration failure



[ Upstream commit 852b1beecb6ff9326f7ca4bc0fe69ae860ebdb9e ]

The eventfd context is used as our irqbypass token, therefore if an
eventfd is re-used, our token is the same.  The irqbypass code will
return an -EBUSY in this case, but we'll still attempt to unregister
the producer, where if that duplicate token still exists, results in
removing the wrong object.  Clear the token of failed producers so
that they harmlessly fall out when unregistered.

Fixes: 6d7425f1 ("vfio: Register/unregister irq_bypass_producer")
Reported-by: default avatarguomin chen <guomin_chen@sina.com>
Tested-by: default avatarguomin chen <guomin_chen@sina.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 9fbff609
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment