diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-11-08 12:41:28 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-11-09 10:26:51 -0800 |
commit | 154ba79c9f160e652a2c9c46435b928b3bfae11f (patch) | |
tree | 6f3e70405f7f9f7d3443f0ca80b0e59a5d6e70c9 /Kconfig | |
parent | 3ca6c3b43c72a5fd0399d9ee1c7e5af978895ff1 (diff) | |
download | lwn-154ba79c9f160e652a2c9c46435b928b3bfae11f.tar.gz lwn-154ba79c9f160e652a2c9c46435b928b3bfae11f.zip |
genetlink: correctly begin the iteration over policies
The return value from genl_op_iter_init() only tells us if
there are any policies but to begin the iteration (and therefore
load the first entry) we need to call genl_op_iter_next().
Note that it's safe to call genl_op_iter_next() on a family
with no ops, it will just return false.
This may lead to various crashes, a warning in
netlink_policy_dump_get_policy_idx() when policy is not found
or.. no problem at all if the kmalloc'ed memory happens to be
zeroed.
Fixes: b502b3185cd6 ("genetlink: use iterator in the op to policy map dumping")
Link: https://lore.kernel.org/r/20221108204128.330287-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'Kconfig')
0 files changed, 0 insertions, 0 deletions