diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-01-25 13:17:46 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-01-25 13:17:46 +0000 |
commit | f3e5d63bb335cc5a321ef671a4c72ce4782c5c4b (patch) | |
tree | 357b01eee6f114e933039431bd7a6e1d0c91193c /sys/dev/pci/musycc.c | |
parent | 594d750716fb78a106233b68acbaf5a603156b0e (diff) |
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.
Diffstat (limited to 'sys/dev/pci/musycc.c')
-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), |