linux/drivers/net/ethernet
Florian Fainelli 4ba569b001 net: ep93xx_eth: Do not crash unloading module
commit c823abac17 upstream.

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2017-02-23 03:54:42 +00:00
..
3com net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
8390 net: 8390: use time_after() for time comparison 2014-05-18 21:24:52 -04:00
adaptec net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
adi bfin_mac: remove empty MDIO bus reset function 2014-03-28 01:38:02 -04:00
aeroflex net: greth: remove empty MDIO bus reset function 2014-03-28 01:38:01 -04:00
allwinner net: sun4i-emac: fix memory leak on bad packet 2014-12-10 17:49:34 +00:00
alteon net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
altera Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-05-24 00:32:30 -04:00
amd amd-xgbe: fix a couple timeout loops 2016-01-25 10:43:50 +00:00
apple macmace: add missing platform_set_drvdata() in mace_probe() 2013-11-11 14:02:08 -05:00
arc arc_emac: add netpoll support 2014-05-13 18:02:24 -04:00
atheros atl2: Disable unimplemented scatter/gather feature 2016-06-15 21:29:25 +01:00
broadcom net: bcmgenet: Utilize correct struct device for all DMA operations 2017-02-23 03:54:42 +00:00
brocade bna: fix interrupts storm caused by erroneous packets 2015-08-27 14:19:47 +01:00
cadence Revert "net/macb: add pinctrl consumer support" 2014-10-15 12:05:29 +02:00
calxeda net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
chelsio cxgb4: use dev_port to identify ports 2014-06-25 16:01:54 -07:00
cirrus net: ep93xx_eth: Do not crash unloading module 2017-02-23 03:54:42 +00:00
cisco enic: fix rx skb checksum 2015-01-19 11:37:50 +00:00
davicom dm9000: avoid sleeping in dm9000_timeout callback 2014-06-05 15:12:11 -07:00
dec tulip: Poll link status more frequently for Comet chips 2014-06-22 17:12:36 -07:00
dlink net: use SPEED_UNKNOWN and DUPLEX_UNKNOWN when appropriate 2014-06-06 16:24:07 -07:00
emulex be2net: set EQ DB clear-intr bit in be_open() 2014-07-11 14:34:33 -07:00
faraday net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
freescale powerpc/ucc_geth: deal with a compile warning 2014-07-07 19:48:19 -07:00
fujitsu net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
hisilicon net: hisilicon: add hix5hd2 mac driver 2014-06-02 23:39:05 -07:00
hp hp100: replace hardcoded name in /proc/interrupts with interface name 2013-09-27 17:38:32 -04:00
i825xx i825xx: Call dev_kfree_skb_any instead of dev_kfree_skb. 2014-03-24 21:19:02 -07:00
ibm net: ehea: avoid null pointer dereference 2016-08-22 22:38:03 +01:00
icplus net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
intel i40e: avoid NULL pointer dereference and recursive errors on early PCI error 2017-02-23 03:54:08 +00:00
marvell net: ethernet: mvneta: Remove IFF_UNICAST_FLT which is not implemented 2017-02-23 03:54:40 +00:00
mellanox net/mlx4: Fix uninitialized fields in rule when adding promiscuous mode to device managed flow steering 2017-02-23 03:54:40 +00:00
micrel ethernet: micrel: fix some error codes 2016-05-01 00:06:02 +02:00
microchip net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
moxa net: moxa: fix an error code 2016-03-24 10:01:14 +00:00
myricom myri10ge: check for DMA mapping errors 2014-10-15 12:05:26 +02:00
natsemi net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
neterion net: use SPEED_UNKNOWN and DUPLEX_UNKNOWN when appropriate 2014-06-06 16:24:07 -07:00
nuvoton drivers:net: delete premature free_irq 2013-09-04 13:18:19 -04:00
nvidia net: use SPEED_UNKNOWN and DUPLEX_UNKNOWN when appropriate 2014-06-06 16:24:07 -07:00
nxp lpc_eth: Use resource_size instead of computation 2014-06-03 16:08:52 -07:00
octeon Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
oki-semi net: use SPEED_UNKNOWN and DUPLEX_UNKNOWN when appropriate 2014-06-06 16:24:07 -07:00
packetengines net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
pasemi drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
qlogic qlcnic: use the correct ring in qlcnic_83xx_process_rcv_ring_diag() 2016-08-22 22:38:25 +01:00
rdc r6040: remove empty MDIO bus reset function 2014-03-28 01:38:02 -04:00
realtek r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40 2014-07-16 22:23:55 -07:00
renesas sh_eth: remove unchecked interrupts for RZ/A1 2017-02-23 03:54:42 +00:00
samsung net: sxgbe: remove duplicate SXGBE_CORE_L34_ADDCTL_REG define 2014-06-11 15:01:30 -07:00
seeq drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
sfc sfc: on MC reset, clear PIO buffer linkage in TXQs 2016-08-22 22:38:05 +01:00
sgi drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
silan sc92031: Call dev_consume_skb_any instead of dev_kfree_skb. 2014-03-24 21:19:08 -07:00
sis net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
smsc smsc911x: power-up phydev before doing a software reset. 2014-11-27 11:21:57 +00:00
stmicro stmmac: Correctly report PTP capabilities. 2015-12-09 11:40:51 +00:00
sun niu: don't count tx error twice in case of headroom realloc fails 2015-08-25 10:13:51 +01:00
tehuti net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
ti net: ethernet: ti: cpsw: fix secondary-emac probe error path 2017-02-23 03:54:37 +00:00
tile net: tile: fix unused variable warning 2014-06-16 21:33:50 -07:00
toshiba net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a memory allocation 2014-06-11 00:13:16 -07:00
tundra drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
via via-rhine: fix full-duplex with autoneg disable 2014-06-12 10:31:10 -07:00
wiznet net: w5100: Use devm_ioremap_resource() 2014-02-28 16:57:24 -05:00
xilinx xilinx: Use time_before_eq() 2014-05-22 15:50:13 -04:00
xircom ethernet: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
xscale net: ptp: move PTP classifier in its own file 2014-04-01 16:43:18 -04:00
dnet.c dnet: remove empty MDIO bus reset function 2014-03-28 01:38:02 -04:00
dnet.h dnet: Move the Dave Ethernet driver 2011-08-12 23:46:51 -07:00
ec_bhf.c driver/net/ethernet/ec_bhf.c: fix sparse warnings 2014-05-14 16:09:33 -04:00
ethoc.c net: ethoc: Fix early error paths 2016-11-20 01:16:50 +00:00
fealnx.c net: fealnx: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:01 -04:00
jme.c jme: Fix device PM wakeup API usage 2016-05-01 00:06:15 +02:00
jme.h jme: Remove unused #define PFX 2013-11-07 02:14:32 -05:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-06-03 23:32:12 -07:00
korina.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00
lantiq_etop.c netdevice: add queue selection fallback handler for ndo_select_queue 2014-02-17 00:36:34 -05:00
Makefile net: hisilicon: add hix5hd2 mac driver 2014-06-02 23:39:05 -07:00
netx-eth.c ethernet: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
s6gmac.c drivers/net: delete non-required instances of include <linux/init.h> 2014-01-16 11:53:26 -08:00