[PATCH] net: add mutex_unlock on xfrm4_protocol_register

2018-04-18 Thread sunlianwen
The function of xfrm4_protocol_register() don't release
the mutx lock, which potential cause deadlock.

Signed-off-by: Lianwen Sun 
---
 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(_protocol_mutex);
+
+   return ret;
+
 err:
mutex_unlock(_protocol_mutex);
 
-- 
2.17.0
.





[PATCH v3] net: change the comment of dev_mc_init

2018-04-17 Thread sunlianwen
The comment of dev_mc_init() is wrong. which use dev_mc_flush
instead of dev_mc_init.

Signed-off-by: Lianwen Sun 

[PATCH v2] net: change the comment of dev_mc_init

2018-04-17 Thread sunlianwen

The comment of dev_mc_init() is wrong. which use dev_mc_flush
instead of dev_mc_init.

Signed-off-by: Lianwen Sun 
---
 net/core/dev_addr_lists.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index e3e6a3e2ca22..d884d8f5f0e5 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -839,7 +839,7 @@ void dev_mc_flush(struct net_device *dev)
 EXPORT_SYMBOL(dev_mc_flush);

 /**
- * dev_mc_flush - Init multicast address list
+ * dev_mc_init - Init multicast address list
  * @dev: device
  *
  * Init multicast address list.
--
2.17.0




[PATCH] net: change the comment of dev_mc_init

2018-04-17 Thread sunlianwen

the comment of dev_mc_init() is wrong. which use dev_mc_flush
instead of dev_mc_init.


Signed-off-by:Lianwen Sun 
---
 net/core/dev_addr_lists.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index e3e6a3e2ca22..d884d8f5f0e5 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -839,7 +839,7 @@ void dev_mc_flush(struct net_device *dev)
 EXPORT_SYMBOL(dev_mc_flush);

 /**
- * dev_mc_flush - Init multicast address list
+ * dev_mc_init - Init multicast address list
  * @dev: device
  *
  * Init multicast address list.
--
2.17.0