]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/net/netfilter/nf_tables.h
netfilter: nf_tables: fix type mismatch with error return from nft_parse_u32_check
[linux.git] / include / net / netfilter / nf_tables.h
index 5031e072567bd85318d5a6ab240b3ab79199facd..d79d1e9b95461bc869c6149f80d7e3789bcb89ac 100644 (file)
@@ -145,7 +145,7 @@ static inline enum nft_registers nft_type_to_reg(enum nft_data_types type)
        return type == NFT_DATA_VERDICT ? NFT_REG_VERDICT : NFT_REG_1 * NFT_REG_SIZE / NFT_REG32_SIZE;
 }
 
-unsigned int nft_parse_u32_check(const struct nlattr *attr, int max, u32 *dest);
+int nft_parse_u32_check(const struct nlattr *attr, int max, u32 *dest);
 unsigned int nft_parse_register(const struct nlattr *attr);
 int nft_dump_register(struct sk_buff *skb, unsigned int attr, unsigned int reg);
 
@@ -542,7 +542,8 @@ void *nft_set_elem_init(const struct nft_set *set,
                        const struct nft_set_ext_tmpl *tmpl,
                        const u32 *key, const u32 *data,
                        u64 timeout, gfp_t gfp);
-void nft_set_elem_destroy(const struct nft_set *set, void *elem);
+void nft_set_elem_destroy(const struct nft_set *set, void *elem,
+                         bool destroy_expr);
 
 /**
  *     struct nft_set_gc_batch_head - nf_tables set garbage collection batch
@@ -693,7 +694,6 @@ static inline int nft_expr_clone(struct nft_expr *dst, struct nft_expr *src)
 {
        int err;
 
-       __module_get(src->ops->type->owner);
        if (src->ops->clone) {
                dst->ops = src->ops;
                err = src->ops->clone(dst, src);
@@ -702,6 +702,8 @@ static inline int nft_expr_clone(struct nft_expr *dst, struct nft_expr *src)
        } else {
                memcpy(dst, src, src->ops->size);
        }
+
+       __module_get(src->ops->type->owner);
        return 0;
 }