From: David Miller <davem@davemloft.net>
To: f.fainelli@gmail.com
Cc: netdev@vger.kernel.org, hsweeten@visionengravers.com
Subject: Re: [PATCH net] net: ep93xx_eth: Do not crash unloading module
Date: Mon, 05 Dec 2016 15:36:02 -0500 (EST) [thread overview]
Message-ID: <20161205.153602.1770726597007697695.davem@davemloft.net> (raw)
In-Reply-To: <20161205032205.14127-1-f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Sun, 4 Dec 2016 19:22:05 -0800
> 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>
Applied, thanks Florian.
next prev parent reply other threads:[~2016-12-05 20:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 3:22 [PATCH net] net: ep93xx_eth: Do not crash unloading module Florian Fainelli
2016-12-05 20:36 ` David Miller [this message]
2016-12-06 20:44 ` Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161205.153602.1770726597007697695.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hsweeten@visionengravers.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).