.. | .. |
---|
41 | 41 | if (IS_ERR(obj)) |
---|
42 | 42 | return -ENOENT; |
---|
43 | 43 | |
---|
| 44 | + if (!nft_use_inc(&obj->use)) |
---|
| 45 | + return -EMFILE; |
---|
| 46 | + |
---|
44 | 47 | nft_objref_priv(expr) = obj; |
---|
45 | | - obj->use++; |
---|
46 | 48 | |
---|
47 | 49 | return 0; |
---|
48 | 50 | } |
---|
.. | .. |
---|
71 | 73 | if (phase == NFT_TRANS_COMMIT) |
---|
72 | 74 | return; |
---|
73 | 75 | |
---|
74 | | - obj->use--; |
---|
| 76 | + nft_use_dec(&obj->use); |
---|
75 | 77 | } |
---|
76 | 78 | |
---|
77 | 79 | static void nft_objref_activate(const struct nft_ctx *ctx, |
---|
.. | .. |
---|
79 | 81 | { |
---|
80 | 82 | struct nft_object *obj = nft_objref_priv(expr); |
---|
81 | 83 | |
---|
82 | | - obj->use++; |
---|
| 84 | + nft_use_inc_restore(&obj->use); |
---|
83 | 85 | } |
---|
84 | 86 | |
---|
85 | 87 | static struct nft_expr_type nft_objref_type; |
---|
.. | .. |
---|
180 | 182 | { |
---|
181 | 183 | struct nft_objref_map *priv = nft_expr_priv(expr); |
---|
182 | 184 | |
---|
183 | | - priv->set->use++; |
---|
| 185 | + nf_tables_activate_set(ctx, priv->set); |
---|
184 | 186 | } |
---|
185 | 187 | |
---|
186 | 188 | static void nft_objref_map_destroy(const struct nft_ctx *ctx, |
---|