The function of xfrm4_protocol_register() don't release
the mutx lock, which potential cause deadlock.

Signed-off-by: Lianwen Sun <sunlw.f...@cn.fujitsu.com>
---
 net/ipv4/xfrm4_protocol.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv4/xfrm4_protocol.c b/net/ipv4/xfrm4_protocol.c
index 8dd0e6ab8606..1ee34edef9d2 100644
--- a/net/ipv4/xfrm4_protocol.c
+++ b/net/ipv4/xfrm4_protocol.c
@@ -240,6 +240,10 @@ int xfrm4_protocol_register(struct xfrm4_protocol *handler,
 
        ret = 0;
 
+       mutex_unlock(&xfrm4_protocol_mutex);
+
+       return ret;
+
 err:
        mutex_unlock(&xfrm4_protocol_mutex);
 
-- 
2.17.0
.



Reply via email to