From: Johannes Berg <johannes@sipsolutions.net>
To: Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: backports@vger.kernel.org
Subject: Re: [PATCH V2] backport: handle change in netdevice destructor usage
Date: Wed, 21 Jun 2017 23:17:29 +0200 [thread overview]
Message-ID: <1498079849.9688.1.camel@sipsolutions.net> (raw)
In-Reply-To: <1498078699-27809-1-git-send-email-arend.vanspriel@broadcom.com> (sfid-20170621_225830_268542_FFBDC610)
On Wed, 2017-06-21 at 21:58 +0100, Arend van Spriel wrote:
> This patch deals with changes made in struct net_device by commit
> cf124db566e6 ("net: Fix inconsistent teardown and release of private
> netdev state.").
>
> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> ---
> Hi Johannes,
>
> It took a while for me to be happy with this version. More so because
> I
> found that brcmfmac has a double-free bug if register_netdevice()
> fails
> so I needed to solve that puzzle. Below is the changelog.
>
> Regards,
> Arend
>
> V2:
> - changed netdev_set_priv_destructor() to macro.
> - revised semantic patch covering drivers only needing
> free_netdev().
> - used some tricks suggested by Julia in semantic patch.
> - added more version checks against 4.13.
> ---
> backport/backport-include/linux/netdevice.h | 9 ++++
> patches/0079-netdev-destructor.cocci | 84
> +++++++++++++++++++++++++++++
> 2 files changed, 93 insertions(+)
> create mode 100644 patches/0079-netdev-destructor.cocci
>
> diff --git a/backport/backport-include/linux/netdevice.h
> b/backport/backport-include/linux/netdevice.h
> index 06230b5..0f5b198 100644
> --- a/backport/backport-include/linux/netdevice.h
> +++ b/backport/backport-include/linux/netdevice.h
> @@ -320,4 +320,13 @@ static inline void netif_trans_update(struct
> net_device *dev)
> }
> #endif
>
> +#if LINUX_VERSION_IS_LESS(4,13,0)
> +#define netdev_set_priv_destructor(_dev, _destructor) \
> + (_dev)->destructor = __ ## _destructor
> +#else
Won't this cause annoying warnings, that __##_destructor is an unused
function, when compiling for higher kernels?
johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in
next prev parent reply other threads:[~2017-06-21 21:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 20:58 [PATCH V2] backport: handle change in netdevice destructor usage Arend van Spriel
2017-06-21 21:17 ` Johannes Berg [this message]
2017-06-21 21:18 ` Johannes Berg
2017-06-21 21:50 ` Arend van Spriel
2017-06-21 21:52 ` Johannes Berg
2017-06-21 21:53 ` Arend van Spriel
-- strict thread matches above, loose matches on Subject: below --
2017-06-21 9:40 Arend van Spriel
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=1498079849.9688.1.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=arend.vanspriel@broadcom.com \
--cc=backports@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