From 1be7285567f67447699f50c5c93b2a84b587ba75 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 16 Jan 2015 15:25:18 -0600 Subject: [PATCH] TM4C Ethernet: Add some assertions --- arch/arm/src/tiva/tm4c_ethernet.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/tiva/tm4c_ethernet.c b/arch/arm/src/tiva/tm4c_ethernet.c index 992f0bffc9..14acdab76c 100644 --- a/arch/arm/src/tiva/tm4c_ethernet.c +++ b/arch/arm/src/tiva/tm4c_ethernet.c @@ -1660,6 +1660,13 @@ static void tiva_receive(FAR struct tiva_ethmac_s *priv) { struct net_driver_s *dev = &priv->dev; + /* I have seen this error just after writing a new image to FLASH. After + * resetting he board, I never see it again. I am guessing that the + * flasher leaves the hardware in a bad state(?). + */ + + DEBUGASSERT(dev->d_buf != NULL); + /* Loop while while tiva_recvframe() successfully retrieves valid * Ethernet frames. */ @@ -2041,7 +2048,9 @@ static inline void tiva_interrupt_process(FAR struct tiva_ethmac_s *priv) #ifdef CONFIG_NET_NOINTS static void tiva_interrupt_work(FAR void *arg) { - FAR struct tiva_ethmac_s *priv = ( FAR struct tiva_ethmac_s *)arg; + FAR struct tiva_ethmac_s *priv = (FAR struct tiva_ethmac_s *)arg; + + DEBUGASSERT(priv); /* Process pending Ethernet interrupts */