Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Fix unlocking in vioif_rx_filter



details:   https://anonhg.NetBSD.org/src/rev/2c6e2e18ad65
branches:  trunk
changeset: 820965:2c6e2e18ad65
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue Jan 17 01:25:21 2017 +0000

description:
Fix unlocking in vioif_rx_filter

diffstat:

 sys/dev/pci/if_vioif.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r abaf9c18dfd6 -r 2c6e2e18ad65 sys/dev/pci/if_vioif.c
--- a/sys/dev/pci/if_vioif.c    Tue Jan 17 01:24:44 2017 +0000
+++ b/sys/dev/pci/if_vioif.c    Tue Jan 17 01:25:21 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vioif.c,v 1.30 2016/12/28 07:32:16 ozaki-r Exp $    */
+/*     $NetBSD: if_vioif.c,v 1.31 2017/01/17 01:25:21 ozaki-r Exp $    */
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.30 2016/12/28 07:32:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.31 2017/01/17 01:25:21 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1451,12 +1451,12 @@
        while (nentries++, enm != NULL) {
                if (nentries >= VIRTIO_NET_CTRL_MAC_MAXENTRIES) {
                        allmulti = 1;
-                       goto set;
+                       goto set_unlock;
                }
                if (memcmp(enm->enm_addrlo, enm->enm_addrhi,
                           ETHER_ADDR_LEN)) {
                        allmulti = 1;
-                       goto set;
+                       goto set_unlock;
                }
                memcpy(sc->sc_ctrl_mac_tbl_mc->macs[nentries],
                       enm->enm_addrlo, ETHER_ADDR_LEN);
@@ -1464,9 +1464,10 @@
        }
        rxfilter = 1;
 
-set:
+set_unlock:
        ETHER_UNLOCK(&sc->sc_ethercom);
 
+set:
        if (rxfilter) {
                sc->sc_ctrl_mac_tbl_uc->nentries = 0;
                sc->sc_ctrl_mac_tbl_mc->nentries = nentries;



Home | Main Index | Thread Index | Old Index