| .. | .. |
|---|
| 54 | 54 | sample_policy, NULL); |
|---|
| 55 | 55 | if (ret < 0) |
|---|
| 56 | 56 | return ret; |
|---|
| 57 | | - if (!tb[TCA_SAMPLE_PARMS] || !tb[TCA_SAMPLE_RATE] || |
|---|
| 58 | | - !tb[TCA_SAMPLE_PSAMPLE_GROUP]) |
|---|
| 57 | + |
|---|
| 58 | + if (!tb[TCA_SAMPLE_PARMS]) |
|---|
| 59 | 59 | return -EINVAL; |
|---|
| 60 | 60 | |
|---|
| 61 | 61 | parm = nla_data(tb[TCA_SAMPLE_PARMS]); |
|---|
| .. | .. |
|---|
| 69 | 69 | |
|---|
| 70 | 70 | if (!exists) { |
|---|
| 71 | 71 | ret = tcf_idr_create(tn, index, est, a, |
|---|
| 72 | | - &act_sample_ops, bind, true, 0); |
|---|
| 72 | + &act_sample_ops, bind, true, flags); |
|---|
| 73 | 73 | if (ret) { |
|---|
| 74 | 74 | tcf_idr_cleanup(tn, index); |
|---|
| 75 | 75 | return ret; |
|---|
| .. | .. |
|---|
| 79 | 79 | tcf_idr_release(*a, bind); |
|---|
| 80 | 80 | return -EEXIST; |
|---|
| 81 | 81 | } |
|---|
| 82 | + |
|---|
| 83 | + if (!tb[TCA_SAMPLE_RATE] || !tb[TCA_SAMPLE_PSAMPLE_GROUP]) { |
|---|
| 84 | + NL_SET_ERR_MSG(extack, "sample rate and group are required"); |
|---|
| 85 | + err = -EINVAL; |
|---|
| 86 | + goto release_idr; |
|---|
| 87 | + } |
|---|
| 88 | + |
|---|
| 82 | 89 | err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack); |
|---|
| 83 | 90 | if (err < 0) |
|---|
| 84 | 91 | goto release_idr; |
|---|