Page MenuHomeFreeBSD

D60679.diff
No OneTemporary

D60679.diff

diff --git a/usr.sbin/bhyve/pci_virtio_input.c b/usr.sbin/bhyve/pci_virtio_input.c
--- a/usr.sbin/bhyve/pci_virtio_input.c
+++ b/usr.sbin/bhyve/pci_virtio_input.c
@@ -467,19 +467,14 @@
vtinput_eventqueue_add_event(
struct vtinput_eventqueue *queue, struct input_event *e)
{
- /* check if queue is full */
if (queue->idx >= queue->size) {
- /* alloc new elements for queue */
- const uint32_t newSize = queue->idx;
- void *newPtr = realloc(queue->events,
- queue->size * sizeof(struct vtinput_event_elem));
- if (newPtr == NULL) {
- WPRINTF(("%s: realloc memory for eventqueue failed!",
- __func__));
+ const size_t nsize = queue->idx + VTINPUT_MAX_PKT_LEN;
+ void *ptr = realloc(queue->events,
+ nsize * sizeof(struct vtinput_event_elem));
+ if (ptr == NULL)
return (1);
- }
- queue->events = newPtr;
- queue->size = newSize;
+ queue->events = ptr;
+ queue->size = nsize;
}
/* save event */
@@ -584,8 +579,7 @@
}
static void
-vtinput_read_event(int fd __attribute((unused)),
- enum ev_type t __attribute__((unused)), void *arg __attribute__((unused)))
+vtinput_read_event(int fd __unused, enum ev_type t __unused, void *arg)
{
struct pci_vtinput_softc *sc = arg;

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 14, 7:46 PM (8 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40765737
Default Alt Text
D60679.diff (1 KB)

Event Timeline