Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb urtwn(4): Check for allocation failure in urtwn_...



details:   https://anonhg.NetBSD.org/src/rev/bb08f12e3415
branches:  trunk
changeset: 1018375:bb08f12e3415
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Feb 01 06:59:37 2021 +0000

description:
urtwn(4): Check for allocation failure in urtwn_tx_beacon.

Candidate fix for PR kern/55968.

diffstat:

 sys/dev/usb/if_urtwn.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 1938c653e9c4 -r bb08f12e3415 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Mon Feb 01 04:49:02 2021 +0000
+++ b/sys/dev/usb/if_urtwn.c    Mon Feb 01 06:59:37 2021 +0000
@@ -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 @@
 {
        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);
 }
 



Home | Main Index | Thread Index | Old Index