diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-07-28 10:50:57 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2017-07-28 10:50:57 +0000 |
commit | 6d2e8816090d35a301d80eaf855d0ef0ad9773c9 (patch) | |
tree | 24ddcf0c99e0c702a310529c51423a3435b7e6b5 | |
parent | af1859eb772788013880a2b301b353f1996f8fe6 (diff) |
The read buffer size reported by the hardware can be up to 4095
bytes. This would exceed the mbuf cluster size. Use larger clusters
in this case.
bug report Ilja Van Sprundel; OK deraadt@ stsp@
-rw-r--r-- | sys/dev/usb/if_uath.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c index 96ec1ef753e..3fa4118b076 100644 --- a/sys/dev/usb/if_uath.c +++ b/sys/dev/usb/if_uath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uath.c,v 1.80 2017/03/26 15:31:15 deraadt Exp $ */ +/* $OpenBSD: if_uath.c,v 1.81 2017/07/28 10:50:56 bluhm Exp $ */ /*- * Copyright (c) 2006 @@ -587,7 +587,7 @@ uath_alloc_rx_data_list(struct uath_softc *sc) error = ENOMEM; goto fail; } - MCLGET(data->m, M_DONTWAIT); + MCLGETI(data->m, M_DONTWAIT, NULL, sc->rxbufsz); if (!(data->m->m_flags & M_EXT)) { printf("%s: could not allocate rx mbuf cluster\n", sc->sc_dev.dv_xname); @@ -1201,7 +1201,7 @@ uath_data_rxeof(struct usbd_xfer *xfer, void *priv, ifp->if_ierrors++; goto skip; } - MCLGET(mnew, M_DONTWAIT); + MCLGETI(mnew, M_DONTWAIT, NULL, sc->rxbufsz); if (!(mnew->m_flags & M_EXT)) { printf("%s: could not allocate rx mbuf cluster\n", sc->sc_dev.dv_xname); |