Subject: [PATCH 1/8] xfrm: handle NETDEV_UNREGISTER for xfrm device

From: Steffen Klassert <[email-masked]>
Date: Fri, 27 Mar 2020 09:10:00 +0100

From: Raed Salem <[email-masked]>

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 <[email-masked]>
Reviewed-by: Boris Pismenny <[email-masked]>
Reviewed-by: Saeed Mahameed <[email-masked]>
Signed-off-by: Steffen Klassert <[email-masked]>
---
 net/xfrm/xfrm_device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 50f567a88f45..3231ec628544 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -383,6 +383,7 @@ static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void
 		return xfrm_dev_feat_change(dev);
 
 	case NETDEV_DOWN:
+	case NETDEV_UNREGISTER:
 		return xfrm_dev_down(dev);
 	}
 	return NOTIFY_DONE;
-- 
2.17.1