Date: Thu, 6 Jun 2019 20:54:10 +0000 (UTC) From: Luiz Otavio O Souza <loos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348759 - head/sys/dev/gpio Message-ID: <201906062054.x56KsAHC019090@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: loos Date: Thu Jun 6 20:54:09 2019 New Revision: 348759 URL: https://svnweb.freebsd.org/changeset/base/348759 Log: Zero the GPIO regulator pins memory. This fixes a panic in Espressobin when gpioregulator fails to allocate the GPIO pin (the GPIO controller is not there). Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/gpio/gpioregulator.c Modified: head/sys/dev/gpio/gpioregulator.c ============================================================================== --- head/sys/dev/gpio/gpioregulator.c Thu Jun 6 20:35:41 2019 (r348758) +++ head/sys/dev/gpio/gpioregulator.c Thu Jun 6 20:54:09 2019 (r348759) @@ -248,7 +248,7 @@ gpioregulator_parse_fdt(struct gpioregulator_softc *sc /* "gpios" property */ sc->init_def.npins = 32 - __builtin_clz(mask); sc->init_def.pins = malloc(sc->init_def.npins * - sizeof(sc->init_def.pins), M_DEVBUF, M_WAITOK); + sizeof(sc->init_def.pins), M_DEVBUF, M_WAITOK | M_ZERO); for (n = 0; n < sc->init_def.npins; n++) { error = gpio_pin_get_by_ofw_idx(sc->dev, node, n, &sc->init_def.pins[n]);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906062054.x56KsAHC019090>