Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175841712
D60679.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D60679.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 14, 7:45 PM (8 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40765737
Default Alt Text
D60679.diff (1 KB)
Attached To
Mode
D60679: bhyve: Fix virtio-input event array resizing
Attached
Detach File
Event Timeline
Log In to Comment