Module Name: src
Committed By: riastradh
Date: Mon Feb 1 06:59:37 UTC 2021
Modified Files:
src/sys/dev/usb: if_urtwn.c
Log Message:
urtwn(4): Check for allocation failure in urtwn_tx_beacon.
Candidate fix for PR kern/55968.
To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/dev/usb/if_urtwn.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.90 src/sys/dev/usb/if_urtwn.c:1.91
--- src/sys/dev/usb/if_urtwn.c:1.90 Mon Feb 1 04:46:33 2021
+++ src/sys/dev/usb/if_urtwn.c Mon Feb 1 06:59:37 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: if_urtwn.c,v 1.90 2021/02/01 04:46:33 nia Exp $ */
+/* $NetBSD: if_urtwn.c,v 1.91 2021/02/01 06:59:37 riastradh Exp $ */
/* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */
/*-
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.90 2021/02/01 04:46:33 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.91 2021/02/01 06:59:37 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -854,6 +854,10 @@ urtwn_tx_beacon(struct urtwn_softc *sc,
{
struct urtwn_tx_data *data =
urtwn_get_tx_data(sc, sc->ac2idx[WME_AC_VO]);
+
+ if (data == NULL)
+ return ENOBUFS;
+
return urtwn_tx(sc, m, ni, data);
}