summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-08-10 12:58:50 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-08-10 12:58:50 +0000
commit4f5e8a4930cff623270a8d67e13778210e091921 (patch)
tree363f211a0aa6003234da2e655a73c9bf27fa8363 /sys/dev/usb
parent6f0839aaad147c27d8bc39c6288ebb36506e4ab9 (diff)
Do not allocate space for the whole structure when we just want to store
a pointer, found by clang.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/usb_subr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index 75027b8d83f..2a7a75d0af1 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_subr.c,v 1.107 2014/08/09 09:45:14 mpi Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.108 2014/08/10 12:58:49 mpi Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -909,8 +909,7 @@ usbd_probe_and_attach(struct device *parent, struct usbd_device *dev, int port,
}
nifaces = dev->cdesc->bNumInterface;
uaa.configno = dev->cdesc->bConfigurationValue;
- ifaces = malloc(nifaces * sizeof(struct usbd_interface),
- M_USB, M_NOWAIT);
+ ifaces = malloc(nifaces * sizeof(*ifaces), M_USB, M_NOWAIT);
if (ifaces == NULL) {
err = USBD_NOMEM;
goto fail;