Module Name: src
Committed By: chs
Date: Fri Dec 29 23:01:02 UTC 2023
Modified Files:
src/sys/net: if_tun.c
Log Message:
tun: add missing kpreempt_enable() if pktq_enqueue() fails
To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/net/if_tun.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/net/if_tun.c
diff -u src/sys/net/if_tun.c:1.173 src/sys/net/if_tun.c:1.174
--- src/sys/net/if_tun.c:1.173 Mon Mar 28 12:33:22 2022
+++ src/sys/net/if_tun.c Fri Dec 29 23:01:02 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tun.c,v 1.173 2022/03/28 12:33:22 riastradh Exp $ */
+/* $NetBSD: if_tun.c,v 1.174 2023/12/29 23:01:02 chs Exp $ */
/*
* Copyright (c) 1988, Julian Onions <[email protected]>
@@ -19,7 +19,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.173 2022/03/28 12:33:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tun.c,v 1.174 2023/12/29 23:01:02 chs Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -982,6 +982,7 @@ tunwrite(dev_t dev, struct uio *uio, int
}
kpreempt_disable();
if (__predict_false(!pktq_enqueue(pktq, top, 0))) {
+ kpreempt_enable();
if_statinc(ifp, if_collisions);
mutex_exit(&tp->tun_lock);
error = ENOBUFS;