correct device status write size
authordv <dv@openbsd.org>
Sun, 29 Aug 2021 11:14:27 +0000 (11:14 +0000)
committerdv <dv@openbsd.org>
Sun, 29 Aug 2021 11:14:27 +0000 (11:14 +0000)
Reported by Ilja van Sprundel.

ok mlarkin@

usr.sbin/vmd/virtio.c

index e365503..30580c0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: virtio.c,v 1.93 2021/08/29 11:09:05 dv Exp $  */
+/*     $OpenBSD: virtio.c,v 1.94 2021/08/29 11:14:27 dv Exp $  */
 
 /*
  * Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org>
@@ -679,7 +679,7 @@ vioblk_notifyq(struct vioblk_dev *dev)
                            ds_desc_idx);
                        goto out;
                }
-               if (write_mem(ds_desc->addr, &ds, ds_desc->len)) {
+               if (write_mem(ds_desc->addr, &ds, sizeof(ds))) {
                        log_warnx("%s: can't write device status data @ 0x%llx",
                            __func__, ds_desc->addr);
                        goto out;