From: Andrew Cooper Date: Wed, 11 Jan 2017 17:51:44 +0000 (+0000) Subject: x86/sysctl: Fix NULL pointer dereference in error path X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2991 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2704c78aaa156e6843681ee344dd0ce75dbc63b2;p=xen.git x86/sysctl: Fix NULL pointer dereference in error path This was introduced by c/s c38869e711 "x86/cpuid: Drop the temporary linear feature bitmap from struct cpuid_policy", and caught by Coverity. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index 87da541841..b8c30d4c04 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -230,8 +230,8 @@ long arch_do_sysctl( /* Bad featureset index? */ if ( !p ) ret = -EINVAL; - - cpuid_policy_to_featureset(p, featureset); + else + cpuid_policy_to_featureset(p, featureset); /* Copy the requested featureset into place. */ if ( !ret && copy_to_guest(sysctl->u.cpu_featureset.features,