From 85aa1e74ad3339cd1ea4debfa8a85f2d92dcd47e Mon Sep 17 00:00:00 2001 From: ozaki-r Date: Wed, 20 Jul 2016 07:37:51 +0000 Subject: Apply pserialize to some iterations of IP address lists --- sys/dev/qbus/if_dmc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/qbus/if_dmc.c b/sys/dev/qbus/if_dmc.c index 2dfa1433309..a8997037bcf 100644 --- a/sys/dev/qbus/if_dmc.c +++ b/sys/dev/qbus/if_dmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_dmc.c,v 1.25 2016/07/07 09:32:02 ozaki-r Exp $ */ +/* $NetBSD: if_dmc.c,v 1.26 2016/07/20 07:37:51 ozaki-r Exp $ */ /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.25 2016/07/07 09:32:02 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.26 2016/07/20 07:37:51 ozaki-r Exp $"); #undef DMCDEBUG /* for base table dump on fatal error */ @@ -313,9 +313,12 @@ dmcinit(struct ifnet *ifp) * Check to see that an address has been set * (both local and destination for an address family). */ - IFADDR_READER_FOREACH(ifa, ifp) + s = pserialize_read_enter(); + IFADDR_READER_FOREACH(ifa, ifp) { if (ifa->ifa_addr->sa_family && ifa->ifa_dstaddr->sa_family) break; + } + pserialize_read_exit(s); if (ifa == NULL) return 0; -- cgit