diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 0bc92edb7..f4bbddfbb 100755 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -5354,10 +5354,8 @@ static int nf_tables_getsetelem(struct net *net, struct sock *nlsk, nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) { err = nft_get_set_elem(&ctx, set, attr); - if (err < 0) { - NL_SET_BAD_ATTR(extack, attr); + if (err < 0) break; - } } return err; @@ -5850,10 +5848,8 @@ static int nf_tables_newsetelem(struct net *net, struct sock *nlsk, nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) { err = nft_add_set_elem(&ctx, set, attr, nlh->nlmsg_flags); - if (err < 0) { - NL_SET_BAD_ATTR(extack, attr); + if (err < 0) return err; - } } if (nft_net->validate_state == NFT_VALIDATE_DO) @@ -6062,10 +6058,9 @@ static int nf_tables_delsetelem(struct net *net, struct sock *nlsk, nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) { err = nft_del_setelem(&ctx, set, attr); - if (err < 0) { - NL_SET_BAD_ATTR(extack, attr); + if (err < 0) break; - } + set->ndeact++; } return err;