代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/kmod 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From bd96d05256db2ff9a89dbe2e8bb6e26fcb800052 Mon Sep 17 00:00:00 2001
From: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
Date: Sun, 29 Nov 2020 18:47:36 +0200
Subject: [PATCH] depmod: output_builtin_alias_bin: free idx on error path
reason:depmod: output_builtin_alias_bin free idx on error path
Conflict:NA
Reference:https://lore.kernel.org/linux-modules/20201129164737.135866-2-yauheni.kaliuta@redhat.com/T/#u
idx is allocated in the beginning but it's not freed if there is
a failure after the allocation.
Change the error path: return immediately if idx allocation fails
and then free it in both success and error path at the end.
Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
---
tools/depmod.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/tools/depmod.c b/tools/depmod.c
index 875e314..2c03dfe 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -2412,10 +2412,8 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
return 0;
idx = index_create();
- if (idx == NULL) {
- ret = -ENOMEM;
- goto fail;
- }
+ if (idx == NULL)
+ return -ENOMEM;
ret = kmod_module_get_builtin(depmod->ctx, &builtin);
if (ret < 0) {
@@ -2458,13 +2456,12 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
if (count)
index_write(idx, out);
-
- index_destroy(idx);
-
fail:
if (builtin)
kmod_module_unref_list(builtin);
+ index_destroy(idx);
+
return ret;
}
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。