From: Andreas Herrmann Date: Thu, 9 Apr 2009 13:07:29 +0000 (+0200) Subject: x86: cacheinfo: correct return value when cache_disable feature is not active X-Git-Tag: upstream/snapshot3+hdmi~18695^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=845d8c761ec763871936c62b837c4a9ea6d0fbdb;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git x86: cacheinfo: correct return value when cache_disable feature is not active Impact: bug fix If user writes to "cache_disable" attribute on a CPU that does not support this feature, the process hangs due to an invalid return value in store_cache_disable(). Signed-off-by: Andreas Herrmann Cc: Andrew Morton Cc: Mark Langsdorf LKML-Reference: <20090409130729.GH31527@alberich.amd.com> Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 7240126..1ab46e0 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c @@ -771,7 +771,7 @@ store_cache_disable(struct _cpuid4_info *this_leaf, const char *buf, unsigned int ret, index, val; if (!this_leaf->can_disable) - return 0; + return -EINVAL; if (strlen(buf) > 15) return -EINVAL;