mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] vdpasim: Rerun status in vdpasim_get_status
@ 2020-03-31  3:35 YueHaibing
  2020-03-31  5:29 ` Jason Wang
  2020-03-31  6:08 ` [PATCH v2 -next] vdpasim: Return " YueHaibing
  0 siblings, 2 replies; 4+ messages in thread
From: YueHaibing @ 2020-03-31  3:35 UTC (permalink / raw)
  To: mst, jasowang, yuehaibing; +Cc: virtualization, linux-kernel

vdpasim->status should acquired under spin lock.

Fixes: 870448c31775 ("vdpasim: vDPA device simulator")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c b/drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c
index 6e8a0cf2fdeb..72863d01a12a 100644
--- a/drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/virtio/vdpa/vdpa_sim/vdpa_sim.c
@@ -488,7 +488,7 @@ static u8 vdpasim_get_status(struct vdpa_device *vdpa)
 	status = vdpasim->status;
 	spin_unlock(&vdpasim->lock);
 
-	return vdpasim->status;
+	return status;
 }
 
 static void vdpasim_set_status(struct vdpa_device *vdpa, u8 status)
-- 
2.17.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-02  2:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31  3:35 [PATCH -next] vdpasim: Rerun status in vdpasim_get_status YueHaibing
2020-03-31  5:29 ` Jason Wang
2020-03-31  6:08 ` [PATCH v2 -next] vdpasim: Return " YueHaibing
2020-04-02  2:49   ` [PATCH v3 " YueHaibing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome