From d6edf2795c26f58982a6a1f6c7cbeb01f7facf96 Mon Sep 17 00:00:00 2001 From: Alexander Usyskin Date: Mon, 19 Nov 2018 09:45:18 +0200 Subject: [PATCH] dm: mei: check for state before link reset callback Prevent intercepting reset callback if reset state transition is already in progress. Tracked-On: #1846 Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Acked-by: Acked-by: Yu Wang --- devicemodel/hw/pci/virtio/virtio_mei.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devicemodel/hw/pci/virtio/virtio_mei.c b/devicemodel/hw/pci/virtio/virtio_mei.c index 34ce2e74f..c388dd0a1 100644 --- a/devicemodel/hw/pci/virtio/virtio_mei.c +++ b/devicemodel/hw/pci/virtio/virtio_mei.c @@ -2010,6 +2010,9 @@ vmei_reset_callback(int fd, enum ev_type type, void *param) char buf[MEI_DEV_STATE_LEN] = {0}; int sz; + if (vmei->status != VMEI_STS_READY) + return; + lseek(fd, 0, SEEK_SET); sz = read(fd, buf, 12); if (first_time) {