Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp886122yba; Thu, 18 Apr 2019 11:12:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+ysug/+vNpnnlrN6ykobRzIvx2z85S7JD+bNiAP21yjlXrxLkVy9hRKsvRs0HTKUJG+Ee X-Received: by 2002:aa7:9389:: with SMTP id t9mr98907229pfe.60.1555611135750; Thu, 18 Apr 2019 11:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611135; cv=none; d=google.com; s=arc-20160816; b=bw1NEpA2FC64utC7DtpgQ96PFGnVTOMrEwiwMhfpjszSWvdykOn6DUAOymjVd8QGJQ 3nfFTpS14E7wePwQTJkWC6jYQIATAbSXO0P96O1csA7Vxb/6by6rNBypB6xypxPR1Obg 8bEKn+uyFpGqZ6P1OAgpNYgUiIzhJ7L84b5Ny+/lS5WxwOOrKVJTYFfBbf/tyrqNwrXG 2XHtKDyH6KWDAQY94q7JA3ekJCowBSoPIMGhKwxU54rMeVvN6RRmqO7QZ1tAl5Gl3Thf U0l4WQMhTXBnP0V83YBvKVi+CuDa04YZ6qs3/v1yX5kcCpLFyD26yhWiNv6NdYeQflbr S2Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qe0AQaGq5509DJ+g/Hy56x1MwJRvJcMbrqCLfIjQf/A=; b=f5kCVguui8wQ+kde3kW6q9fpC/bUPsY/C8HWLhchasOBOACZupAvhqPpzxLKPPd584 72SYH9Rhrm61J5YqTksrgC8DcUEkLSOe2pi6VIImNbb/SkaeIRkjaluzgD4dq2eYg9ad mxUqzBiOlBAfTLjSOKKCI54UVywdWM8pxTd21cdunseEx6iYICRDlOWeMGeg+eT1S3/f 8MkR8awVEXoYjlRvOp9SFznNv4NM453n71xMk+fBvolBh5sjlOn3XpjAEg/cydPDmVFF Lp5j16EHOTUtJ2g47TXEQWIKACENASYjZ+hDd++pz/oRtEao30gSnYRrOQR4UtC+CFeX 5SuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=17uHAjyk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15si2920501pfj.115.2019.04.18.11.12.01; Thu, 18 Apr 2019 11:12:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=17uHAjyk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391841AbfDRSJJ (ORCPT + 99 others); Thu, 18 Apr 2019 14:09:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:40624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391533AbfDRSJH (ORCPT ); Thu, 18 Apr 2019 14:09:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 254D121871; Thu, 18 Apr 2019 18:09:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610946; bh=0UPkEvrKYdCW8jnBQghSe4seVAjovMENmuWztmSbG5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=17uHAjykmSAEMIM0TpURzlCgjo5JcisSRgdMyq8osvQvb0ly0IVokAFlQBsyBnB9l 0hiYxHFrSutY+6lQe6j5TuicYyGKyVugTDappVViDNrL3faqUTEOhUm5Ry2SfLVCQW M3ywr9qt1zWx6TtVR8C6dZrgMhc2W8B0CeKnlJRY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Desaulniers , Nathan Chancellor , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , clang-built-linux@googlegroups.com, Sasha Levin Subject: [PATCH 4.9 25/50] x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error Date: Thu, 18 Apr 2019 19:57:36 +0200 Message-Id: <20190418160425.866241024@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160422.455656724@linuxfoundation.org> References: <20190418160422.455656724@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit e898e69d6b9475bf123f99b3c5d1a67bb7cb2361 ] When building with -Wsometimes-uninitialized, Clang warns: arch/x86/kernel/hw_breakpoint.c:355:2: warning: variable 'align' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] The default cannot be reached because arch_build_bp_info() initializes hw->len to one of the specified cases. Nevertheless the warning is valid and returning -EINVAL makes sure that this cannot be broken by future modifications. Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Gleixner Reviewed-by: Nick Desaulniers Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: clang-built-linux@googlegroups.com Link: https://github.com/ClangBuiltLinux/linux/issues/392 Link: https://lkml.kernel.org/r/20190307212756.4648-1-natechancellor@gmail.com Signed-off-by: Sasha Levin --- arch/x86/kernel/hw_breakpoint.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c index 8771766d46b6..9954a604a822 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c @@ -352,6 +352,7 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) #endif default: WARN_ON_ONCE(1); + return -EINVAL; } /* -- 2.19.1