mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 21:51:40 +00:00
genetlink: don't merge dumpit split op for different cmds into single iter
Currently, split ops of doit and dumpit are merged into a single iter item when they are subsequent. However, there is no guarantee that the dumpit op is for the same cmd as doit op. Fix this by checking if cmd is the same for both. This problem does not occur in existing families. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20231021112711.660606-2-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
b7c4f5730a
commit
f862ed2d0b
@ -225,7 +225,8 @@ static void genl_op_from_split(struct genl_op_iter *iter)
|
||||
}
|
||||
|
||||
if (i + cnt < family->n_split_ops &&
|
||||
family->split_ops[i + cnt].flags & GENL_CMD_CAP_DUMP) {
|
||||
family->split_ops[i + cnt].flags & GENL_CMD_CAP_DUMP &&
|
||||
(!cnt || family->split_ops[i + cnt].cmd == iter->doit.cmd)) {
|
||||
iter->dumpit = family->split_ops[i + cnt];
|
||||
genl_op_fill_in_reject_policy_split(family, &iter->dumpit);
|
||||
cnt++;
|
||||
|
Loading…
Reference in New Issue
Block a user