[PATCH 4.14 103/148] xfrm: handle NETDEV_UNREGISTER for xfrm device

From: Greg Kroah-Hartman
Date: Wed Apr 01 2020 - 12:45:19 EST


From: Raed Salem <raeds@xxxxxxxxxxxx>

commit 03891f820c2117b19e80b370281eb924a09cf79f upstream.

This patch to handle the asynchronous unregister
device event so the device IPsec offload resources
could be cleanly released.

Fixes: e4db5b61c572 ("xfrm: policy: remove pcpu policy cache")
Signed-off-by: Raed Salem <raeds@xxxxxxxxxxxx>
Reviewed-by: Boris Pismenny <borisp@xxxxxxxxxxxx>
Reviewed-by: Saeed Mahameed <saeedm@xxxxxxxxxxxx>
Signed-off-by: Steffen Klassert <steffen.klassert@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
net/xfrm/xfrm_device.c | 1 +
1 file changed, 1 insertion(+)

--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -187,6 +187,7 @@ static int xfrm_dev_event(struct notifie
return xfrm_dev_feat_change(dev);

case NETDEV_DOWN:
+ case NETDEV_UNREGISTER:
return xfrm_dev_down(dev);
}
return NOTIFY_DONE;