linux/drivers/net/ethernet/cirrus
Florian Fainelli c823abac17 net: ep93xx_eth: Do not crash unloading module
When we unload the ep93xx_eth, whether we have opened the network
interface or not, we will either hit a kernel paging request error, or a
simple NULL pointer de-reference because:

- if ep93xx_open has been called, we have created a valid DMA mapping
  for ep->descs, when we call ep93xx_stop, we also call
  ep93xx_free_buffers, ep->descs now has a stale value

- if ep93xx_open has not been called, we have a NULL pointer for
  ep->descs, so performing any operation against that address just won't
  work

Fix this by adding a NULL pointer check for ep->descs which means that
ep93xx_free_buffers() was able to successfully tear down the descriptors
and free the DMA cookie as well.

Fixes: 1d22e05df8 ("[PATCH] Cirrus Logic ep93xx ethernet driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-05 15:35:39 -05:00
..
cs89x0.c net: cx89x0: Add DT support 2016-06-15 12:17:57 -07:00
cs89x0.h cs89x0: Move the driver into the Cirrus dir 2011-10-18 23:41:43 -04:00
ep93xx_eth.c net: ep93xx_eth: Do not crash unloading module 2016-12-05 15:35:39 -05:00
Kconfig drivers/net: remove all references to obsolete Ethernet-HOWTO 2015-06-23 06:50:35 -07:00
mac89x0.c cirrus/mac89x0: Remove superfluous interrupt disable/restore 2014-10-24 00:43:28 -04:00
Makefile net/ethernet: Move mac89x0.c from apple to cirrus 2011-11-01 19:30:38 -04:00