Author: arybchik
Date: Wed Mar 25 10:57:26 2015
New Revision: 280555
URL: https://svnweb.freebsd.org/changeset/base/280555

Log:
  MFC: 279078
  
  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)

Modified:
  stable/10/sys/dev/sfxge/common/efx_ev.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_ev.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_ev.c     Wed Mar 25 10:56:53 2015        
(r280554)
+++ stable/10/sys/dev/sfxge/common/efx_ev.c     Wed Mar 25 10:57:26 2015        
(r280555)
@@ -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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to