[Devel] [PATCH RH9] ve/printk: fix error handling in ve_log_init

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Mon Oct 4 13:15:11 MSK 2021


On succesful setup_log_buf_ve we should not free log and return 0,
that's wrong. This leads to zero log_state on succesful ve start and
leads to crash in ve_log_destroy.

https://jira.sw.ru/browse/PSBM-134393
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 kernel/printk/printk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 47ec962371ae..ff8a41260284 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3741,7 +3741,7 @@ int ve_log_init(struct ve_struct *ve)
 		return -ENOMEM;
 
 	ret = setup_log_buf_ve(log, ve, 0);
-	if (!ret) {
+	if (ret) {
 		kfree(log);
 		return ret;
 	}
-- 
2.31.1



More information about the Devel mailing list