hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/sched/act_sample.c
....@@ -54,8 +54,8 @@
5454 sample_policy, NULL);
5555 if (ret < 0)
5656 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])
5959 return -EINVAL;
6060
6161 parm = nla_data(tb[TCA_SAMPLE_PARMS]);
....@@ -69,7 +69,7 @@
6969
7070 if (!exists) {
7171 ret = tcf_idr_create(tn, index, est, a,
72
- &act_sample_ops, bind, true, 0);
72
+ &act_sample_ops, bind, true, flags);
7373 if (ret) {
7474 tcf_idr_cleanup(tn, index);
7575 return ret;
....@@ -79,6 +79,13 @@
7979 tcf_idr_release(*a, bind);
8080 return -EEXIST;
8181 }
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
+
8289 err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack);
8390 if (err < 0)
8491 goto release_idr;