Date: Wed, 1 Oct 2025 09:38:53 GMT From: Ahmad Khalifa <vexeduxr@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 39139fec932e - stable/14 - gpioc: allocate priv->events with the correct size Message-ID: <202510010938.5919crgl016590@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=39139fec932edc313e891b0a49db61ad2c64b1fe commit 39139fec932edc313e891b0a49db61ad2c64b1fe Author: Ahmad Khalifa <vexeduxr@FreeBSD.org> AuthorDate: 2025-09-30 11:09:28 +0000 Commit: Ahmad Khalifa <vexeduxr@FreeBSD.org> CommitDate: 2025-10-01 09:08:55 +0000 gpioc: allocate priv->events with the correct size MFC after: 1 day (cherry picked from commit fa26e445544eb88f05779258e2ab9c96384fe74d) --- sys/dev/gpio/gpioc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/gpio/gpioc.c b/sys/dev/gpio/gpioc.c index 067a43617f11..a3595c849a21 100644 --- a/sys/dev/gpio/gpioc.c +++ b/sys/dev/gpio/gpioc.c @@ -699,7 +699,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); return (0); @@ -909,7 +909,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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202510010938.5919crgl016590>