aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/usb-msd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index 1a11bc557e..0afb03133c 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -535,7 +535,7 @@ static int usb_msd_initfn(USBDevice *dev)
usb_msd_handle_reset(dev);
if (bdrv_key_required(s->conf.dinfo->bdrv)) {
- if (s->dev.qdev.hotplugged) {
+ if (cur_mon) {
monitor_read_bdrv_key_start(cur_mon, s->conf.dinfo->bdrv,
usb_msd_password_cb, s);
s->dev.auto_attach = 0;