[Devel] [PATCH RHEL8 COMMIT] Revert "vtty: fixed error path in vtty_map_alloc"
Konstantin Khorenko
khorenko at virtuozzo.com
Wed Jun 9 14:19:28 MSK 2021
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.37
------>
commit 759376ebe2f874e03ec9a9bc994b97360159cebb
Author: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
Date: Wed Jun 9 14:19:28 2021 +0300
Revert "vtty: fixed error path in vtty_map_alloc"
This reverts commit 6338d75642a5cde2f9686f04e7919f744cef02f6.
https://jira.sw.ru/browse/PSBM-83150
Signed-off-by: Valeriy Vdovin <valeriy.vdovin at virtuozzo.com>
---
drivers/tty/pty.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index b4ab0eacca5b..75633be9e412 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -1047,13 +1047,11 @@ static vtty_map_t *vtty_map_alloc(envid_t veid)
lockdep_assert_held(&tty_mutex);
if (map) {
- int id;
-
map->veid = veid;
- id = idr_alloc(&vtty_idr, map, veid, veid + 1, GFP_KERNEL);
- if (id < 0) {
+ veid = idr_alloc(&vtty_idr, map, veid, veid + 1, GFP_KERNEL);
+ if (veid < 0) {
kfree(map);
- return ERR_PTR(id);
+ return ERR_PTR(veid);
}
} else
map = ERR_PTR(-ENOMEM);
More information about the Devel
mailing list