Module Name: src Committed By: martin Date: Sat Sep 21 12:22:36 UTC 2024
Modified Files: src/sys/net [netbsd-10]: if_gif.c Log Message: Pull up following revision(s) (requested by rin in ticket #901): sys/net/if_gif.c: revision 1.159 Drop locks before freeing unreferenced memory in gif_set_tunnel To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.157.4.1 src/sys/net/if_gif.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_gif.c diff -u src/sys/net/if_gif.c:1.157 src/sys/net/if_gif.c:1.157.4.1 --- src/sys/net/if_gif.c:1.157 Sat Sep 3 02:47:59 2022 +++ src/sys/net/if_gif.c Sat Sep 21 12:22:36 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: if_gif.c,v 1.157 2022/09/03 02:47:59 thorpej Exp $ */ +/* $NetBSD: if_gif.c,v 1.157.4.1 2024/09/21 12:22:36 martin Exp $ */ /* $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $ */ /* @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.157 2022/09/03 02:47:59 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.157.4.1 2024/09/21 12:22:36 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -1160,12 +1160,13 @@ gif_set_tunnel(struct ifnet *ifp, struct return 0; out: + mutex_exit(&sc->gif_lock); + encap_lock_exit(); + sockaddr_free(nsrc); sockaddr_free(ndst); kmem_free(nvar, sizeof(*nvar)); - mutex_exit(&sc->gif_lock); - encap_lock_exit(); #ifndef GIF_MPSAFE splx(s); #endif