Commit b4d13d3e authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

vdso: Check kdat.compat_cr in vdso_fill_compat_symtable

Just slightly prettify code, no functional change.
Reviewed-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent b85b5bca
...@@ -421,6 +421,9 @@ static int vdso_fill_compat_symtable(struct vdso_symtable *native, ...@@ -421,6 +421,9 @@ static int vdso_fill_compat_symtable(struct vdso_symtable *native,
void *vdso_mmap; void *vdso_mmap;
int ret = -1; int ret = -1;
if (!kdat.compat_cr)
return 0;
vdso_mmap = mmap(NULL, COMPAT_VDSO_BUF_SZ, PROT_READ | PROT_WRITE, vdso_mmap = mmap(NULL, COMPAT_VDSO_BUF_SZ, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_ANON, -1, 0); MAP_SHARED | MAP_ANON, -1, 0);
if (vdso_mmap == MAP_FAILED) { if (vdso_mmap == MAP_FAILED) {
...@@ -464,8 +467,8 @@ int vdso_init(void) ...@@ -464,8 +467,8 @@ int vdso_init(void)
pr_err("Failed to fill self vdso symtable\n"); pr_err("Failed to fill self vdso symtable\n");
return -1; return -1;
} }
if (kdat.compat_cr &&
vdso_fill_compat_symtable(&vdso_sym_rt, &vdso_compat_rt)) { if (vdso_fill_compat_symtable(&vdso_sym_rt, &vdso_compat_rt)) {
pr_err("Failed to fill compat vdso symtable\n"); pr_err("Failed to fill compat vdso symtable\n");
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment