diff options
author | Cong Wang <[email protected]> | 2018-08-19 12:22:05 -0700 |
---|---|---|
committer | David S. Miller <[email protected]> | 2018-08-21 12:45:44 -0700 |
commit | edfaf94fa705181eeb2fe0c36c0b902dedbd40f1 (patch) | |
tree | 72127013952f5bc69ceb15132b8d67060db120da /tools/perf/scripts/python | |
parent | b93c1b5ac8643cc08bb74fa8ae21d6c63dfcb23d (diff) |
net_sched: improve and refactor tcf_action_put_many()
tcf_action_put_many() is mostly called to clean up actions on
failure path, but tcf_action_put_many(&actions[acts_deleted]) is
used in the ugliest way: it passes a slice of the array and
uses an additional NULL at the end to avoid out-of-bound
access.
acts_deleted is completely unnecessary since we can teach
tcf_action_put_many() scan the whole array and checks against
NULL pointer. Which also means tcf_action_delete() should
set deleted action pointers to NULL to avoid double free.
Fixes: 90b73b77d08e ("net: sched: change action API to use array of pointers to actions")
Cc: Jiri Pirko <[email protected]>
Cc: Vlad Buslov <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions