1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

sfxge: add assertions that required event handlers are implemented

efx_ev_mcdi() does not assert or check that all event handlers it
calls are non-null.  Add assertions at the top for all required
event handlers, as some events (in the case of this bug, monitor
events) are rare.

Submitted by:   Ben Hutchings
Sponsored by:   Solarflare Communications, Inc.
Approved by:    gnn (mentor)
This commit is contained in:
Andrew Rybchenko 2015-02-20 19:42:05 +00:00
parent 612d8e2828
commit 6da0beb5ac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279078

View File

@ -567,6 +567,12 @@ efx_ev_mcdi(
if (enp->en_family != EFX_FAMILY_SIENA)
goto out;
EFSYS_ASSERT(eecp->eec_link_change != NULL);
EFSYS_ASSERT(eecp->eec_exception != NULL);
#if EFSYS_OPT_MON_STATS
EFSYS_ASSERT(eecp->eec_monitor != NULL);
#endif
EFX_EV_QSTAT_INCR(eep, EV_MCDI_RESPONSE);
code = EFX_QWORD_FIELD(*eqp, MCDI_EVENT_CODE);