summaryrefslogtreecommitdiff
path: root/include/linux/flex_array.h
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2016-12-04 19:22:05 -0800
committerBen Hutchings <ben@decadent.org.uk>2017-02-23 03:54:42 +0000
commit4ba569b0011d742d27530b81622058e8c81c1257 (patch)
tree48d179d45ccb9308cea09a3e8b5ad99e54f80513 /include/linux/flex_array.h
parent718d94ed19281af41d6042c2d8e2089d348c424e (diff)
net: ep93xx_eth: Do not crash unloading module
commit c823abac17926767fb50175e098f087a6ac684c3 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: 1d22e05df818 ("[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>
Diffstat (limited to 'include/linux/flex_array.h')
0 files changed, 0 insertions, 0 deletions