diff options
| author | 2014-12-13 21:05:32 +0000 | |
|---|---|---|
| committer | 2014-12-13 21:05:32 +0000 | |
| commit | f8238f3e71a8eb02e65b90db598fa2664cb0a2c7 (patch) | |
| tree | d1d22656f8480e9375f3f277691d9ca2527e7d8e /sys/dev/usb/uhidev.c | |
| parent | Sort members by size to reduce structure padding (diff) | |
| download | wireguard-openbsd-f8238f3e71a8eb02e65b90db598fa2664cb0a2c7.tar.xz wireguard-openbsd-f8238f3e71a8eb02e65b90db598fa2664cb0a2c7.zip | |
yet more mallocarray() changes.
ok tedu@ deraadt@
Diffstat (limited to 'sys/dev/usb/uhidev.c')
| -rw-r--r-- | sys/dev/usb/uhidev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index c4ef58db6cd..7144b5f7094 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.65 2014/12/11 18:39:27 mpi Exp $ */ +/* $OpenBSD: uhidev.c,v 1.66 2014/12/13 21:05:33 doug Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -215,7 +215,7 @@ uhidev_attach(struct device *parent, struct device *self, void *aux) printf(", %d report id%s", nrepid, nrepid > 1 ? "s" : ""); printf("\n"); nrepid++; - sc->sc_subdevs = malloc(nrepid * sizeof(struct uhidev *), + sc->sc_subdevs = mallocarray(nrepid, sizeof(struct uhidev *), M_USBDEV, M_NOWAIT | M_ZERO); if (sc->sc_subdevs == NULL) { printf("%s: no memory\n", DEVNAME(sc)); |
