Date: Wed, 26 Jul 2017 21:59:37 +0000 (UTC) From: Marius Strobl <marius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321588 - head/sys/dev/mmc Message-ID: <201707262159.v6QLxb6F008681@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marius Date: Wed Jul 26 21:59:37 2017 New Revision: 321588 URL: https://svnweb.freebsd.org/changeset/base/321588 Log: Correctly use the size of a pointer rather than that of a pointer to a pointer. Reported by: Coverity CID: 1378432 Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Wed Jul 26 21:23:09 2017 (r321587) +++ head/sys/dev/mmc/mmc.c Wed Jul 26 21:59:37 2017 (r321588) @@ -1892,7 +1892,7 @@ child_common: if (child != NULL) { device_set_ivars(child, ivar); sc->child_list = realloc(sc->child_list, - sizeof(device_t *) * sc->child_count + 1, + sizeof(device_t) * sc->child_count + 1, M_DEVBUF, M_WAITOK); sc->child_list[sc->child_count++] = child; } else @@ -1934,7 +1934,7 @@ mmc_update_child_list(struct mmc_softc *sc) if (i != j) sc->child_list[i] = child; } - sc->child_list = realloc(sc->child_list, sizeof(device_t *) * + sc->child_list = realloc(sc->child_list, sizeof(device_t) * sc->child_count, M_DEVBUF, M_WAITOK); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707262159.v6QLxb6F008681>