Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp906208yba; Thu, 18 Apr 2019 11:33:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1EJFVZlX2PvraREm1upY92F19fhOs+E73+nPHGBjXbXGHjsjfKsonGz0+N07gSq/dzwZ8 X-Received: by 2002:a62:69c2:: with SMTP id e185mr97083401pfc.119.1555612425449; Thu, 18 Apr 2019 11:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555612425; cv=none; d=google.com; s=arc-20160816; b=SHhqt48mEC+EKwKckEPEcmQ07dxxF4kIRzg4CP7e7wRy8z9ebkX63JlTzUmJGjNJOs LkRm10U2EE6Rp0YBKhKDJIsbpFiZQWXvlSV36ca2uVhW/0WTVoSovq/ZV9VyccknLg9G LDCuR3U1uIYPwuJNLXobhOffrKPssMTuaI7w3NhZb2PFzLw8ISDQ2gDuS2ObDxzIp+vc s5/mszg+u8sipnr+d3S8cgql4LZPRiKv23Zv31/6Pt3pRyV86J5rewRTv2+NjVKEK2PK 2WUbcGXarAZw5wB3RpCe2E7/mW6ZSRjqTcQiCTdqXfr1j20Pw0c3B0Uf3pX70EV8xor+ Suaw== 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=8IzLOj6Lv7wOfG6fRhFHfojOqiWF/vJfaEjXFXsdZkY=; b=sltL+L7Fotq/bEfKxd93h289nQUAvAh6dIrvcMhxhVDrQrsZqFkFZNspc0aiKE9eFy 98QTbANOFG4K7vV5k5UKCjfvl3pELXueUbk0rgmLA5U8drbk92lY7W4wj02NE9OomXxW fx2T63HeQm2aO3emIgb0nq+xN/qHNyTOdd56TxylPAJjcZMObb3/4GVX3jFjxtqb+VsX DpZsfmdo41ZPmPS05QbSzJWgip4WvjnrozfeE5rKQAoOf5q7rBSZkFBeAB+eHVvm6KNI EpDA0qUNX8wMVd8v0JokW7VMNUzSqcOdTC1gFlycm6ogIbVfrr5jNeGZuYJ8jTfOccwo MCqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=g22E3OtP; 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 h15si2365197pgv.169.2019.04.18.11.33.30; Thu, 18 Apr 2019 11:33:45 -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=g22E3OtP; 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 S2390315AbfDRSAO (ORCPT + 99 others); Thu, 18 Apr 2019 14:00:14 -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: 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 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