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,DKIM_VALID_AU,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 A6DF9C43381 for ; Sat, 30 Mar 2019 01:00:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E6EE206DD for ; Sat, 30 Mar 2019 01:00:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553907637; bh=Fgp/gs20A6fD9JfYsP1GpNbxZLid0tSI3U5KF8wmAx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Y110iZjdQZ0AYHt4cwTA5Ar/0JTFL0VropI990+hzHNsUyFCYlPYdwWMHZ7/XbKne WdKnRSKqtgAJzTOr5Lgp8pxgTeLdzig+BTwJwJymvaG5C0n57i6TsLcMeIiAkQJ8au 3/B9zjnXkIaqSqkrG08BApGTlOauSRpgDwmDVF8c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731585AbfC3A4t (ORCPT ); Fri, 29 Mar 2019 20:56:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:36594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731574AbfC3A4r (ORCPT ); Fri, 29 Mar 2019 20:56:47 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 29DDF218FC; Sat, 30 Mar 2019 00:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553907407; bh=Fgp/gs20A6fD9JfYsP1GpNbxZLid0tSI3U5KF8wmAx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vJhEA3otuxacLF7+ch0v06xVSU1XEOOtF8ePkB8lkyu0kNNCkouQzILznRN7sV6w7 kIyZO/KsAlcn6iRiRwWlpkc7vgO4vBTbCjCDS2GKQYJ3ggnRm/rMgExdGNfLHzq0X1 C9Q1TG+L9lFbHwlDOsswCiyI64xmXm6HUw51i8Mo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , clang-built-linux@googlegroups.com, Sasha Levin Subject: [PATCH AUTOSEL 4.9 25/27] x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error Date: Fri, 29 Mar 2019 20:55:51 -0400 Message-Id: <20190330005555.28087-25-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190330005555.28087-1-sashal@kernel.org> References: <20190330005555.28087-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nathan Chancellor [ 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