[ovs-dev] [1.4 backports 5/6] datapath: Release rtnl_lock if ovs_vport_cmd_build_info() failed

Ben Pfaff blp at nicira.com
Wed Oct 24 19:47:41 UTC 2012


From: Ansis Atteka <aatteka at nicira.com>

This patch fixes a possible lock-up bug where rtnl_lock might not
get released.

This is a crossport of commit 7a6c067d1ad65ae4abdb723b25a4ab591d1d2bc3
from master.

Acked-by: Jesse Gross <jesse at nicira.com>
Signed-off-by: Ansis Atteka <aatteka at nicira.com>
---
 datapath/datapath.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index 11a74da..c030cd2 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1847,10 +1847,9 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
 	reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq,
 					 OVS_VPORT_CMD_NEW);
 	if (IS_ERR(reply)) {
-		err = PTR_ERR(reply);
 		netlink_set_err(INIT_NET_GENL_SOCK, 0,
-				ovs_dp_vport_multicast_group.id, err);
-		return 0;
+				ovs_dp_vport_multicast_group.id, PTR_ERR(reply));
+		goto exit_unlock;
 	}
 
 	genl_notify(reply, genl_info_net(info), info->snd_pid,
-- 
1.7.2.5




More information about the dev mailing list