bpf: Fix a typo in comment for DFS algorithm
authorXu Kuohai <xukuohai@huawei.com>
Thu, 27 Oct 2022 03:44:58 +0000 (23:44 -0400)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 27 Oct 2022 20:10:32 +0000 (13:10 -0700)
There is a typo in comment for DFS algorithm in bpf/verifier.c. The top
element should not be popped until all its neighbors have been checked.
Fix it.

Fixes: 475fb78fbf48 ("bpf: verifier (add branch/goto checks)")
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20221027034458.2925218-1-xukuohai@huaweicloud.com
kernel/bpf/verifier.c

index 8f849a763b793a9d2b467e2047436b3cfb9cbfa9..275c2f1f00ee4065e6f49072d003d91f8c17ec7e 100644 (file)
@@ -10670,7 +10670,7 @@ static int check_return_code(struct bpf_verifier_env *env)
  * 3      let S be a stack
  * 4      S.push(v)
  * 5      while S is not empty
- * 6            t <- S.pop()
+ * 6            t <- S.peek()
  * 7            if t is what we're looking for:
  * 8                return t
  * 9            for all edges e in G.adjacentEdges(t) do