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.0 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=ham 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 1FEBFC282CE for ; Wed, 24 Apr 2019 17:21:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E226821916 for ; Wed, 24 Apr 2019 17:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556126460; bh=2vUkXzwiZvwceuwDRHJCi2E8A0VPYvPLI95wgSnagGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UptJj5Lp9rbawuUb6MCcOMZADseZ7XT1ppH0weOAr48z5fpjck12eCfvxov29WPzX td2qLWPuxhceUAZwyHBKyY3h1+QjtH4f+04gLCzazeob6NW7tIDixvkgutgnNaceT/ e4Dy6q6kdsoiTomG6+85ehCW9GVwUijJnVh3XLIY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389256AbfDXRU7 (ORCPT ); Wed, 24 Apr 2019 13:20:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:46394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388888AbfDXRU6 (ORCPT ); Wed, 24 Apr 2019 13:20:58 -0400 Received: from localhost (62-193-50-229.as16211.net [62.193.50.229]) (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 24ABB20675; Wed, 24 Apr 2019 17:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556126457; bh=2vUkXzwiZvwceuwDRHJCi2E8A0VPYvPLI95wgSnagGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QY7P3X/GOwj0o7O1FTNXTSnJVDx7dvPgKuzAkMVwlJOhowr8t6SPngk1kEjFMNUP5 FsaINdVKBRaSwxVSM4w84ELsWbaQyz7KAzDotwwGeLlSBhg0V6KzwPX59aZXj4Vcjx RCO4o0mF16OBw0DZvyasOjF67HEN9C/DMQzy1H7Q= 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.4 116/168] x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error Date: Wed, 24 Apr 2019 19:09:20 +0200 Message-Id: <20190424170930.323441614@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190424170923.452349382@linuxfoundation.org> References: <20190424170923.452349382@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 2bcfb5f2bc44..433f17d154e2 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c @@ -351,6 +351,7 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp) #endif default: WARN_ON_ONCE(1); + return -EINVAL; } /* -- 2.19.1