diff options
author | 2006-01-25 13:17:45 +0000 | |
---|---|---|
committer | 2006-01-25 13:17:45 +0000 | |
commit | 5d4602a3a93b445b6ff9dcff3ac30b06ed7b3eee (patch) | |
tree | e3f1e63c3530a6a5cd5146925e50d856509f680c | |
parent | use cvs_rcs_getpath() here too + some strings cleanup whilst here. (diff) | |
download | wireguard-openbsd-5d4602a3a93b445b6ff9dcff3ac30b06ed7b3eee.tar.xz wireguard-openbsd-5d4602a3a93b445b6ff9dcff3ac30b06ed7b3eee.zip |
Check if the dma ring got cleared before accessing it. Fixes a panic that
could be triggered in some weird cases. While there adjust a debug output
because it is to verbose for level 1.
-rw-r--r-- | sys/dev/pci/musycc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/musycc.c b/sys/dev/pci/musycc.c index 7087b66e3bd..5032cd9de7d 100644 --- a/sys/dev/pci/musycc.c +++ b/sys/dev/pci/musycc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: musycc.c,v 1.11 2006/01/25 11:02:53 claudio Exp $ */ +/* $OpenBSD: musycc.c,v 1.12 2006/01/25 13:17:45 claudio Exp $ */ /* * Copyright (c) 2004,2005 Internet Business Solutions AG, Zurich, Switzerland @@ -673,7 +673,7 @@ musycc_state_engine(struct musycc_group *mg, int chan, enum musycc_event ev) state = mg->mg_channels[chan]->cc_state; - ACCOOM_PRINTF(1, ("%s: musycc_state_engine state %d event %d\n", + ACCOOM_PRINTF(2, ("%s: musycc_state_engine state %d event %d\n", mg->mg_channels[chan]->cc_ifp->if_xname, state, ev)); switch (ev) { @@ -1161,6 +1161,8 @@ musycc_rxeom(struct musycc_group *mg, int channel, int forcekick) ifp = mg->mg_channels[channel]->cc_ifp; start_rx = cur_rx = mg->mg_dma_d[channel].rx_prod; + if (cur_rx == NULL) + return; /* dma ring got cleared */ do { bus_dmamap_sync(mg->mg_dmat, mg->mg_listmap, ((caddr_t)cur_rx - mg->mg_listkva), |