[ovs-dev] [PATCH] netlink-socket.c: remove local variable in do_lookup_genl_family

Nithin Raju nithin at vmware.com
Tue Sep 9 20:50:57 UTC 2014


'sock' is not initialized and hence should not be un-initialized
as well in the failure path.

Signed-off-by: Nithin Raju <nithin at vmware.com>
Reported-by: Gurucharan Shetty <shettyg at nicira.com>
---
 lib/netlink-socket.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
index a6be186..17e2ea1 100644
--- a/lib/netlink-socket.c
+++ b/lib/netlink-socket.c
@@ -1177,7 +1177,6 @@ static int
 do_lookup_genl_family(const char *name, struct nlattr **attrs,
                       struct ofpbuf **replyp)
 {
-    struct nl_sock *sock;
     struct nlmsghdr *nlmsg;
     struct ofpbuf *reply;
     int error;
@@ -1251,7 +1250,6 @@ do_lookup_genl_family(const char *name, struct nlattr **attrs,
     if (!nl_policy_parse(reply, NLMSG_HDRLEN + GENL_HDRLEN,
                          family_policy, attrs, ARRAY_SIZE(family_policy))
         || nl_attr_get_u16(attrs[CTRL_ATTR_FAMILY_ID]) == 0) {
-        nl_sock_destroy(sock);
         ofpbuf_delete(reply);
         return EPROTO;
     }
-- 
1.7.4.1




More information about the dev mailing list