svn commit: r356075 - head/sys/dev/etherswitch/e6000sw
Ganbold Tsagaankhuu
ganbold at FreeBSD.org
Wed Dec 25 11:26:38 UTC 2019
Author: ganbold
Date: Wed Dec 25 11:26:38 2019
New Revision: 356075
URL: https://svnweb.freebsd.org/changeset/base/356075
Log:
Fix panic when running etherswitchcfg port command.
Modified:
head/sys/dev/etherswitch/e6000sw/e6000sw.c
Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c
==============================================================================
--- head/sys/dev/etherswitch/e6000sw/e6000sw.c Wed Dec 25 09:34:16 2019 (r356074)
+++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Wed Dec 25 11:26:38 2019 (r356075)
@@ -849,6 +849,8 @@ e6000sw_setport(device_t dev, etherswitch_port_t *p)
if (!e6000sw_is_portenabled(sc, p->es_port))
return (0);
+ E6000SW_LOCK(sc);
+
/* Port flags. */
reg = e6000sw_readreg(sc, REG_PORT(sc, p->es_port), PORT_CONTROL2);
if (p->es_flags & ETHERSWITCH_PORT_DROPTAGGED)
@@ -862,7 +864,6 @@ e6000sw_setport(device_t dev, etherswitch_port_t *p)
e6000sw_writereg(sc, REG_PORT(sc, p->es_port), PORT_CONTROL2, reg);
err = 0;
- E6000SW_LOCK(sc);
if (p->es_pvid != 0)
e6000sw_set_pvid(sc, p->es_port, p->es_pvid);
if (e6000sw_is_phyport(sc, p->es_port)) {
More information about the svn-src-all
mailing list