aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Khalifa <vexeduxr@FreeBSD.org>2025-09-30 11:09:28 +0000
committerAhmad Khalifa <vexeduxr@FreeBSD.org>2025-09-30 11:20:25 +0000
commitfa26e445544eb88f05779258e2ab9c96384fe74d (patch)
tree6b1df05e79e1bd82e577437340591e23475aa72e
parent2ffaca551eaf32c17f701762ecf29a961cf19aa4 (diff)
gpioc: allocate priv->events with the correct size
MFC after: 1 day
-rw-r--r--sys/dev/gpio/gpioc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c
index 5a60f939dc78..b56fe6b4c37f 100644
--- a/sys/dev/gpio/gpioc.c
+++ b/sys/dev/gpio/gpioc.c
@@ -704,7 +704,7 @@ gpioc_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
* npins isn't a horrible fifo size for that either.
*/
priv->numevents = priv->sc->sc_npins * 2;
- priv->events = malloc(priv->numevents * sizeof(struct gpio_event_detail),
+ priv->events = malloc(priv->numevents * sizeof(struct gpioc_pin_event),
M_GPIOC, M_WAITOK | M_ZERO);
priv->evidx_head = priv->evidx_tail = 0;
@@ -925,7 +925,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int fflag,
free(priv->events, M_GPIOC);
priv->numevents = evcfg->gp_fifo_size;
priv->events = malloc(priv->numevents *
- sizeof(struct gpio_event_detail), M_GPIOC,
+ sizeof(struct gpioc_pin_event), M_GPIOC,
M_WAITOK | M_ZERO);
priv->evidx_head = priv->evidx_tail = 0;
}