Commit 611a5f3b authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Todd Kjos
Browse files

BACKPORT: hwrng: virtio - unregister device before reset



unregister after reset is clearly wrong - device
can be used while it's reset. There's an attempt to
protect against that using hwrng_removed but it
seems racy since access can be in progress
when the flag is set.

Just unregister, then reset seems simpler and cleaner.
NB: we might be able to drop hwrng_removed in a follow-up patch.

Bug: 324967354
Change-Id: If170f312fa901bf289a01a20d53f713d4c47ec1e
(cherry picked from commit 20762071)
[rkir: the original commit simply moves the reset call,
       which is wrapped into a helper, here it is not yet warpped]
Signed-off-by: default avatarLaurent Vivier <lvivier@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarRoman Kiryanov <rkir@google.com>
parent 8ec555a9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment