aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mge/if_mgevar.h
diff options
context:
space:
mode:
authorZbigniew Bodek <zbb@FreeBSD.org>2015-10-25 22:17:10 +0000
committerZbigniew Bodek <zbb@FreeBSD.org>2015-10-25 22:17:10 +0000
commit446892110dd18e6e70e288cebcd032183a8117a6 (patch)
treeb1990fdbfd3ab4888db282daa439a1f9bc7c048b /sys/dev/mge/if_mgevar.h
parent5420071d3939e016855c10ed1676dbee3fda030f (diff)
downloadsrc-446892110dd18e6e70e288cebcd032183a8117a6.tar.gz
src-446892110dd18e6e70e288cebcd032183a8117a6.zip
Change improper locking assertion in mge
Assertion used here was invalid. If current thread helds any of locks, we never want to recurse on them. Obtained from: Semihalf Submitted by: Bartosz Szczepanek <bsz@semihalf.com> Differential revision: https://reviews.freebsd.org/D3903
Notes
Notes: svn path=/head/; revision=289948
Diffstat (limited to 'sys/dev/mge/if_mgevar.h')
-rw-r--r--sys/dev/mge/if_mgevar.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/mge/if_mgevar.h b/sys/dev/mge/if_mgevar.h
index 1888efba9984..31b9ac379a14 100644
--- a/sys/dev/mge/if_mgevar.h
+++ b/sys/dev/mge/if_mgevar.h
@@ -137,10 +137,8 @@ struct mge_softc {
#define MGE_RECEIVE_LOCK_ASSERT(sc) mtx_assert(&(sc)->receive_lock, MA_OWNED)
#define MGE_GLOBAL_LOCK(sc) do { \
- if ((mtx_owned(&(sc)->transmit_lock) ? 1 : 0) != \
- (mtx_owned(&(sc)->receive_lock) ? 1 : 0)) { \
- panic("mge deadlock possibility detection!"); \
- } \
+ mtx_assert(&(sc)->transmit_lock, MA_NOTOWNED); \
+ mtx_assert(&(sc)->receive_lock, MA_NOTOWNED); \
mtx_lock(&(sc)->transmit_lock); \
mtx_lock(&(sc)->receive_lock); \
} while (0)