Module Name:    src
Committed By:   mlelstv
Date:           Sat Nov 16 22:06:50 UTC 2019

Modified Files:
        src/sys/dev/bluetooth: bth5.c

Log Message:
Don't wait in interrupt context.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/bluetooth/bth5.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/bluetooth/bth5.c
diff -u src/sys/dev/bluetooth/bth5.c:1.5 src/sys/dev/bluetooth/bth5.c:1.6
--- src/sys/dev/bluetooth/bth5.c:1.5	Sun Sep  3 23:11:19 2017
+++ src/sys/dev/bluetooth/bth5.c	Sat Nov 16 22:06:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bth5.c,v 1.5 2017/09/03 23:11:19 nat Exp $	*/
+/*	$NetBSD: bth5.c,v 1.6 2019/11/16 22:06:49 mlelstv Exp $	*/
 /*
  * Copyright (c) 2017 Nathanial Sloss <nathanialsl...@yahoo.com.au>
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bth5.c,v 1.5 2017/09/03 23:11:19 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bth5.c,v 1.6 2019/11/16 22:06:49 mlelstv Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1230,7 +1230,7 @@ bth5_tx_reliable_pkt(struct bth5_softc *
 #endif
 
 	sc->sc_seq_winspace--;
-	_retrans = m_copym(m, 0, M_COPYALL, M_WAIT);
+	_retrans = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
 	if (_retrans == NULL) {
 		aprint_error_dev(sc->sc_dev, "out of memory\n");
 		goto out;
@@ -1488,7 +1488,12 @@ bth5_start_le(struct bth5_softc *sc)
 	if (!sc->sc_le_muzzled) {
 		struct mbuf *m;
 
-		m = m_gethdr(M_WAIT, MT_DATA);
+		m = m_gethdr(M_DONTWAIT, MT_DATA);
+		if (m == NULL) {
+			aprint_error_dev(sc->sc_dev,
+			    "le-packet transmit out of memory\n");
+			return ENOMEM;
+		}
 		m->m_pkthdr.len = m->m_len = 0;
 		m_copyback(m, 0, sizeof(sync), sync);
 		if (!bth5_tx_unreliable_pkt(sc, m, BTH5_CHANNEL_LE)) {

Reply via email to