From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59929C10F14 for ; Thu, 18 Apr 2019 18:32:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23CD1217D7 for ; Thu, 18 Apr 2019 18:32:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555612364; bh=Jfe4LxnnKcdAuXGufB9/wP+WEB9MvzHvf3SaxjB/QPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=uyUb8yS6FlPoWx5v2eb7ocloqaOdSvj0go1xMIzNaF2fsUqNGKgfr2IQ5xZX3hUo8 zhcORq8cvRtSH1UERli8Avee7nAK9Sbkif2J7u2IJyzEc29okU8QoGtQ/15cXw0KDV sfpEHk80TEs0ND7oo5r3kkJ42Okg33LTTWgmrQHk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390308AbfDRSAM (ORCPT ); Thu, 18 Apr 2019 14:00:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:55316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390302AbfDRSAK (ORCPT ); Thu, 18 Apr 2019 14:00:10 -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 5BCA4206B6; Thu, 18 Apr 2019 18:00:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610409; bh=Jfe4LxnnKcdAuXGufB9/wP+WEB9MvzHvf3SaxjB/QPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g22E3OtPACXG1ttB0BPW8XmLCE5JKj1bo5a4X/u40GAVHEC3Oi6xE8nZAukVzLJcU GaJp0hqrYaF3Z8Urs9nKjesh8a31up1OceNRFc5sScjJWt7Zo4SWshnCmfRbarul/H tk9WJMtOCiKBdcfi6yJdmdwNgMdug5XF6+04CYGs= 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.19 049/110] x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error Date: Thu, 18 Apr 2019 19:56:38 +0200 Message-Id: <20190418160443.410234334@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160437.484158340@linuxfoundation.org> References: <20190418160437.484158340@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 34a5c1715148..2882fe1d2a78 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c @@ -357,6 +357,7 @@ int hw_breakpoint_arch_parse(struct perf_event *bp, #endif default: WARN_ON_ONCE(1); + return -EINVAL; } /* -- 2.19.1