Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932535AbZDINHt (ORCPT ); Thu, 9 Apr 2009 09:07:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760186AbZDINHk (ORCPT ); Thu, 9 Apr 2009 09:07:40 -0400 Received: from va3ehsobe004.messaging.microsoft.com ([216.32.180.14]:44364 "EHLO VA3EHSOBE004.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1760723AbZDINHj (ORCPT ); Thu, 9 Apr 2009 09:07:39 -0400 X-BigFish: VPS-6(z34a4jz936eQzz1202hzzz32i6bh65h) X-Spam-TCS-SCL: 4:0 X-WSS-ID: 0KHU4GH-02-NRU-01 Date: Thu, 9 Apr 2009 15:07:29 +0200 From: Andreas Herrmann To: Ingo Molnar , "H. Peter Anvin" CC: Andrew Morton , linux-kernel@vger.kernel.org, Mark Langsdorf Subject: [PATCH 4/8] x86: cacheinfo: correct return value when cache_disable feature is not active Message-ID: <20090409130729.GH31527@alberich.amd.com> References: <20090409125659.GD31527@alberich.amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20090409125659.GD31527@alberich.amd.com> User-Agent: Mutt/1.5.16 (2007-06-09) X-OriginalArrivalTime: 09 Apr 2009 13:07:29.0813 (UTC) FILETIME=[23380C50:01C9B914] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1088 Lines: 35 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(). CC: Mark Langsdorf Signed-off-by: Andreas Herrmann --- arch/x86/kernel/cpu/intel_cacheinfo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 3973506..9dac235 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; -- 1.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/