netlabel: netlink_unicast calls kfree_skb on error path by itself
authorDenis V. Lunev <den@openvz.org>
Thu, 10 Jul 2008 23:53:39 +0000 (16:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Jul 2008 23:53:39 +0000 (16:53 -0700)
So, no need to kfree_skb here on the error path. In this case we can
simply return.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlabel/netlabel_cipso_v4.c
net/netlabel/netlabel_mgmt.c
net/netlabel/netlabel_unlabeled.c

index fdc14a0d21af8fce47ced5d63fc8af46453851a5..9080c61b71a5633a7b4b49199db9b83a4c26559e 100644 (file)
@@ -584,12 +584,7 @@ list_start:
        rcu_read_unlock();
 
        genlmsg_end(ans_skb, data);
-
-       ret_val = genlmsg_reply(ans_skb, info);
-       if (ret_val != 0)
-               goto list_failure;
-
-       return 0;
+       return genlmsg_reply(ans_skb, info);
 
 list_retry:
        /* XXX - this limit is a guesstimate */
index 22c19126780899b464b70f3f4e545b29f1e51f65..44be5d5261f4670005f44276f5fb5a257fe97538 100644 (file)
@@ -386,11 +386,7 @@ static int netlbl_mgmt_listdef(struct sk_buff *skb, struct genl_info *info)
        rcu_read_unlock();
 
        genlmsg_end(ans_skb, data);
-
-       ret_val = genlmsg_reply(ans_skb, info);
-       if (ret_val != 0)
-               goto listdef_failure;
-       return 0;
+       return genlmsg_reply(ans_skb, info);
 
 listdef_failure_lock:
        rcu_read_unlock();
@@ -501,11 +497,7 @@ static int netlbl_mgmt_version(struct sk_buff *skb, struct genl_info *info)
                goto version_failure;
 
        genlmsg_end(ans_skb, data);
-
-       ret_val = genlmsg_reply(ans_skb, info);
-       if (ret_val != 0)
-               goto version_failure;
-       return 0;
+       return genlmsg_reply(ans_skb, info);
 
 version_failure:
        kfree_skb(ans_skb);
index 52b2611a6eb6625f8d1d329bea03d03e7ad460ac..56f80872924e88e5b007b004db93572382c94cd1 100644 (file)
@@ -1107,11 +1107,7 @@ static int netlbl_unlabel_list(struct sk_buff *skb, struct genl_info *info)
                goto list_failure;
 
        genlmsg_end(ans_skb, data);
-
-       ret_val = genlmsg_reply(ans_skb, info);
-       if (ret_val != 0)
-               goto list_failure;
-       return 0;
+       return genlmsg_reply(ans_skb, info);
 
 list_failure:
        kfree_skb(ans_skb);