diff options
author | 2014-07-13 23:10:23 +0000 | |
---|---|---|
committer | 2014-07-13 23:10:23 +0000 | |
commit | 9f6fb5c7f4fbd91f055bd858e78f5b372765ef8e (patch) | |
tree | c9a5c91f733f6bf4c568dc8afebb572c7a07312b /sys/dev/pci/qle.c | |
parent | Split the context allocation out from the configuration. This will allow (diff) | |
download | wireguard-openbsd-9f6fb5c7f4fbd91f055bd858e78f5b372765ef8e.tar.xz wireguard-openbsd-9f6fb5c7f4fbd91f055bd858e78f5b372765ef8e.zip |
Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishian
ok tedu
Diffstat (limited to 'sys/dev/pci/qle.c')
-rw-r--r-- | sys/dev/pci/qle.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c index 91a1f6691d1..e15e49b92e6 100644 --- a/sys/dev/pci/qle.c +++ b/sys/dev/pci/qle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qle.c,v 1.30 2014/07/12 18:48:52 tedu Exp $ */ +/* $OpenBSD: qle.c,v 1.31 2014/07/13 23:10:23 deraadt Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org> @@ -2844,7 +2844,7 @@ qle_alloc_ccbs(struct qle_softc *sc) mtx_init(&sc->sc_port_mtx, IPL_BIO); mtx_init(&sc->sc_mbox_mtx, IPL_BIO); - sc->sc_ccbs = malloc(sizeof(struct qle_ccb) * sc->sc_maxcmds, + sc->sc_ccbs = mallocarray(sc->sc_maxcmds, sizeof(struct qle_ccb), M_DEVBUF, M_WAITOK | M_CANFAIL | M_ZERO); if (sc->sc_ccbs == NULL) { printf("%s: unable to allocate ccbs\n", DEVNAME(sc)); |