提交 2c0f0f36 编写于 作者: J Jon Mediero 提交者: Jessica Yu

module: correctly exit module_kallsyms_on_each_symbol when fn() != 0

Commit 013c1667 ("kallsyms: refactor
{,module_}kallsyms_on_each_symbol") replaced the return inside the
nested loop with a break, changing the semantics of the function: the
break only exits the innermost loop, so the code continues iterating the
symbols of the next module instead of exiting.

Fixes: 013c1667 ("kallsyms: refactor {,module_}kallsyms_on_each_symbol")
Reviewed-by: NPetr Mladek <pmladek@suse.com>
Reviewed-by: NMiroslav Benes <mbenes@suse.cz>
Signed-off-by: NJon Mediero <jmdr@disroot.org>
Signed-off-by: NJessica Yu <jeyu@kernel.org>
上级 02b2fb45
......@@ -4415,9 +4415,10 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
ret = fn(data, kallsyms_symbol_name(kallsyms, i),
mod, kallsyms_symbol_value(sym));
if (ret != 0)
break;
goto out;
}
}
out:
mutex_unlock(&module_mutex);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部