[PATCH 09/10] backports: Make netdev destructor spatch apply correctly again

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The netdev destructor spatch did not apply to the wil6210 driver any
more, because there the calls were done in a different order compared to
the spatch. Add an additional rule which applies when the order is
changed.

Fixes: 30a378636e47 ("backports: speed up netdev destructor spatch by two orders of magnitude")
Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 patches/0079-netdev-destructor.cocci | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/patches/0079-netdev-destructor.cocci b/patches/0079-netdev-destructor.cocci
index f2bea35b..8d7228ec 100644
--- a/patches/0079-netdev-destructor.cocci
+++ b/patches/0079-netdev-destructor.cocci
@@ -67,6 +67,38 @@ if (<+... RET ...+>) {
 	...>
 }
 
+@r11@
+struct net_device *NDEV;
+identifier D, C;
+identifier TRUE =~ "true";
+@@
+C(...)
+{
+	<+...
+-	NDEV->priv_destructor = D;
+-	NDEV->needs_free_netdev = TRUE;
++	netdev_set_priv_destructor(NDEV, D);
+	...+>
+}
+
+@r12 depends on r11@
+identifier r11.D, r11.C;
+fresh identifier E = "__" ## D;
+@@
+
++#if LINUX_VERSION_IS_LESS(4,12,0)
++static void E(struct net_device *ndev)
++{
++	D(ndev);
++	free_netdev(ndev);
++}
++#endif
++
+C(...)
+{
+	...
+}
+
 @r5@
 struct net_device *NDEV;
 identifier TRUE =~ "true";
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux