summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2019-01-12 16:12:11 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2019-01-12 16:12:11 +0000
commit3b48a64cbd682f771effc42ce1b5803c4ee0fdea (patch)
tree352e1fc0464f7cc93296e9816c65171576aa7dca /sys
parent7d16a3014578f3f9e358ba47059808f904f58a49 (diff)
Fix potential use-after-free if xfer allocation fails when otus(4) attaches.
ok mpi@ ian@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/if_otus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c
index 86adec9cfce..a136d5eec76 100644
--- a/sys/dev/usb/if_otus.c
+++ b/sys/dev/usb/if_otus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_otus.c,v 1.61 2019/01/12 16:11:22 stsp Exp $ */
+/* $OpenBSD: if_otus.c,v 1.62 2019/01/12 16:12:10 stsp Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -582,6 +582,7 @@ otus_alloc_tx_cmd(struct otus_softc *sc)
printf("%s: could not allocate xfer buffer\n",
sc->sc_dev.dv_xname);
usbd_free_xfer(cmd->xfer);
+ cmd->xfer = NULL;
return ENOMEM;
}
return 0;