summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-10-19 12:35:17 +0000
committerpatrick <patrick@openbsd.org>2017-10-19 12:35:17 +0000
commit6a67147a407fee94f7f6a85a95f80bdf2f154082 (patch)
tree3f6f38502968995936db3b5a8b73add10d9dc830
parentDisable promisc mode and accepting all multicast packets. These should (diff)
downloadwireguard-openbsd-6a67147a407fee94f7f6a85a95f80bdf2f154082.tar.xz
wireguard-openbsd-6a67147a407fee94f7f6a85a95f80bdf2f154082.zip
Don't forget to free the firmware in the error path, and make sure to
pass the proper size. Caught by Jared McNeill.
-rw-r--r--sys/dev/usb/if_bwfm_usb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/if_bwfm_usb.c b/sys/dev/usb/if_bwfm_usb.c
index 33f02b4331b..db37acfb980 100644
--- a/sys/dev/usb/if_bwfm_usb.c
+++ b/sys/dev/usb/if_bwfm_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bwfm_usb.c,v 1.2 2017/10/15 14:55:13 patrick Exp $ */
+/* $OpenBSD: if_bwfm_usb.c,v 1.3 2017/10/19 12:35:17 patrick Exp $ */
/*
* Copyright (c) 2010-2016 Broadcom Corporation
* Copyright (c) 2016,2017 Patrick Wildt <patrick@blueri.se>
@@ -357,10 +357,11 @@ bwfm_usb_attachhook(struct device *self)
if (bwfm_usb_load_microcode(sc, ucode, size) != 0) {
printf("%s: could not load microcode\n",
DEVNAME(sc));
+ free(ucode, M_DEVBUF, size);
return;
}
- free(ucode, M_DEVBUF, 0);
+ free(ucode, M_DEVBUF, size);
for (i = 0; i < 10; i++) {
delay(100 * 1000);