Commit b63cbc4
bpf: remember meta->iter info only for initialized iters
For iter_new() functions iterator state's slot might not be yet
initialized, in which case iter_get_spi() will return -ERANGE. This is
expected and is handled properly. But for iter_next() and iter_destroy()
cases iter slot is supposed to be initialized and correct, so -ERANGE is
not possible.
Move meta->iter.{spi,frameno} initialization into iter_next/iter_destroy
handling branch to make it more explicit that valid information will be
remembered in meta->iter block for subsequent use in process_iter_next_call(),
avoiding confusingly looking -ERANGE assignment for meta->iter.spi.
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin KaFai Lau <[email protected]>1 parent 1a3148f commit b63cbc4
1 file changed
+7
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6778 | 6778 | | |
6779 | 6779 | | |
6780 | 6780 | | |
6781 | | - | |
6782 | | - | |
6783 | | - | |
6784 | | - | |
6785 | | - | |
6786 | | - | |
6787 | | - | |
6788 | 6781 | | |
6789 | 6782 | | |
6790 | 6783 | | |
| |||
6811 | 6804 | | |
6812 | 6805 | | |
6813 | 6806 | | |
| 6807 | + | |
| 6808 | + | |
| 6809 | + | |
| 6810 | + | |
6814 | 6811 | | |
6815 | 6812 | | |
6816 | 6813 | | |
6817 | 6814 | | |
| 6815 | + | |
| 6816 | + | |
| 6817 | + | |
6818 | 6818 | | |
6819 | 6819 | | |
6820 | 6820 | | |
| |||
0 commit comments