Module Name:    src
Committed By:   riastradh
Date:           Wed Apr 17 18:52:39 UTC 2024

Modified Files:
        src/sys/net: if_tap.c

Log Message:
tap(4): Use DETACH_FORCE with config_detach.

It doesn't make a difference here, because tap_detach never fails,
but let's make it more obvious at the call site that failure is
forbidden here.

No functional change intended.

PR kern/58166


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/net/if_tap.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_tap.c
diff -u src/sys/net/if_tap.c:1.130 src/sys/net/if_tap.c:1.131
--- src/sys/net/if_tap.c:1.130	Wed Apr 17 18:52:25 2024
+++ src/sys/net/if_tap.c	Wed Apr 17 18:52:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tap.c,v 1.130 2024/04/17 18:52:25 riastradh Exp $	*/
+/*	$NetBSD: if_tap.c,v 1.131 2024/04/17 18:52:39 riastradh Exp $	*/
 
 /*
  *  Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.130 2024/04/17 18:52:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.131 2024/04/17 18:52:39 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 
@@ -641,7 +641,7 @@ tap_clone_destroyer(device_t dev)
 	cfdata_t cf = device_cfdata(dev);
 	int error;
 
-	error = config_detach(dev, 0);
+	error = config_detach(dev, DETACH_FORCE);
 	KASSERTMSG(error == 0, "error=%d", error);
 	kmem_free(cf, sizeof(*cf));
 }

Reply via email to