svn commit: r207015 - stable/8/sys/net
Bjoern A. Zeeb
bz at FreeBSD.org
Wed Apr 21 20:00:13 UTC 2010
Author: bz
Date: Wed Apr 21 20:00:13 2010
New Revision: 207015
URL: http://svn.freebsd.org/changeset/base/207015
Log:
MFC r206488:
Take a reference to make sure that the interface cannot go away during
if_clone_destroy() in case parallel threads try to.
PR: kern/116837
Submitted by: Mikolaj Golub (to.my.trociny gmail.com)
Modified:
stable/8/sys/net/if_clone.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
stable/8/sys/geom/sched/ (props changed)
Modified: stable/8/sys/net/if_clone.c
==============================================================================
--- stable/8/sys/net/if_clone.c Wed Apr 21 19:55:43 2010 (r207014)
+++ stable/8/sys/net/if_clone.c Wed Apr 21 20:00:13 2010 (r207015)
@@ -196,10 +196,11 @@ if_clone_createif(struct if_clone *ifc,
int
if_clone_destroy(const char *name)
{
+ int err;
struct if_clone *ifc;
struct ifnet *ifp;
- ifp = ifunit(name);
+ ifp = ifunit_ref(name);
if (ifp == NULL)
return (ENXIO);
@@ -221,10 +222,14 @@ if_clone_destroy(const char *name)
}
#endif
IF_CLONERS_UNLOCK();
- if (ifc == NULL)
+ if (ifc == NULL) {
+ if_rele(ifp);
return (EINVAL);
+ }
- return (if_clone_destroyif(ifc, ifp));
+ err = if_clone_destroyif(ifc, ifp);
+ if_rele(ifp);
+ return err;
}
/*
More information about the svn-src-stable-8
mailing list