summaryrefslogtreecommitdiff
path: root/patches/0079-netdev-destructor.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'patches/0079-netdev-destructor.cocci')
-rw-r--r--patches/0079-netdev-destructor.cocci32
1 files changed, 32 insertions, 0 deletions
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";