netfilter: nf_tables: remove unused variable in nf_tables_dump_set()
[platform/adaptation/renesas_rcar/renesas_kernel.git] / net / netfilter / nf_tables_api.c
index dcddc49..37f0e69 100644 (file)
@@ -180,7 +180,8 @@ static int nf_tables_fill_table_info(struct sk_buff *skb, u32 portid, u32 seq,
        nfmsg->res_id           = 0;
 
        if (nla_put_string(skb, NFTA_TABLE_NAME, table->name) ||
-           nla_put_be32(skb, NFTA_TABLE_FLAGS, htonl(table->flags)))
+           nla_put_be32(skb, NFTA_TABLE_FLAGS, htonl(table->flags)) ||
+           nla_put_be32(skb, NFTA_TABLE_USE, htonl(table->use)))
                goto nla_put_failure;
 
        return nlmsg_end(skb, nlh);
@@ -1953,11 +1954,14 @@ static int nf_tables_set_alloc_name(struct nft_ctx *ctx, struct nft_set *set,
                        return -ENOMEM;
 
                list_for_each_entry(i, &ctx->table->sets, list) {
-                       if (!sscanf(i->name, name, &n))
+                       int tmp;
+
+                       if (!sscanf(i->name, name, &tmp))
                                continue;
-                       if (n < 0 || n > BITS_PER_LONG * PAGE_SIZE)
+                       if (tmp < 0 || tmp > BITS_PER_LONG * PAGE_SIZE)
                                continue;
-                       set_bit(n, inuse);
+
+                       set_bit(tmp, inuse);
                }
 
                n = find_first_zero_bit(inuse, BITS_PER_LONG * PAGE_SIZE);
@@ -2501,9 +2505,8 @@ static int nf_tables_dump_set(struct sk_buff *skb, struct netlink_callback *cb)
        u32 portid, seq;
        int event, err;
 
-       nfmsg = nlmsg_data(cb->nlh);
-       err = nlmsg_parse(cb->nlh, sizeof(*nfmsg), nla, NFTA_SET_ELEM_LIST_MAX,
-                         nft_set_elem_list_policy);
+       err = nlmsg_parse(cb->nlh, sizeof(struct nfgenmsg), nla,
+                         NFTA_SET_ELEM_LIST_MAX, nft_set_elem_list_policy);
        if (err < 0)
                return err;