Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp890370yba; Thu, 18 Apr 2019 11:16:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeh8kEdYd7CEzASUCZjicnrjL0ORjOV3vZrwbWGCRDRC+mZWcKTYlYSKkHQazG/PCA8Ehk X-Received: by 2002:aa7:8b12:: with SMTP id f18mr98140925pfd.89.1555611399038; Thu, 18 Apr 2019 11:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555611399; cv=none; d=google.com; s=arc-20160816; b=wvk0HJXnzaQOrk+rxNH5mUSUBY3nUOVYjt8DOtampetqpma8tqI6AqzII2/M4bGy8s lubl5AeL1xZrVp1xkmyi2acMF9OcVzc7lboVNsB+5n+ARovMjIDAdnQTc/w1O7moBAJC 75daqcv+0lTNGUPDS/I3g5dwBuudldxx4lqd5EVkaF9IFA95UzyPGIEMmgSBMflb5sh7 lKakCo31mUkmlJ7nE6IqWJuQ3mVnz+h4GJBmHoL/xNjRDVVCvi9s4UJUvW3N+qXR2Uo+ Ie2D+YEgHwrAnxYM2lWiO2ibD4Ai0n7LOjPku8Pm2xZ0r6AVijtrJ2oHWj5ObcZv7BFl wiEA== 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=cUEaDLYQbMGus4+kDruwQBFH19fnudjFWUkUWgzwQRo1mDnplcrM6SsJi1/pJSz6ZG gru4/bzZCpmTSmrAOTMmAABeiX5BmoDHIlOggQelgq/e/qo8DKFwDdjT/zWcENtIa29V e/qidWGSPwQgX5nD6NkwsKY/q6DZLrA0MB+J5cNnLZ1dXy0n22FYq4BkSqrlLE4rgPDF cqOc2qUQuuvqGXfLl0Z6jrn3IScmYO99zZXbO0CA0wubgA5yZTZiCLperL0LjX/wqBqe gL5VZ/oSMEh3IFj7ag4Dy/1fPs8QsVP+okAmFa/tJNcW8xLlbfISld1yb+ygff/9X9I/ WKig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rTOabPv4; 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 t136si2473360pgc.538.2019.04.18.11.16.24; Thu, 18 Apr 2019 11:16:39 -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=rTOabPv4; 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 S2404457AbfDRSNi (ORCPT + 99 others); Thu, 18 Apr 2019 14:13:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:46244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404072AbfDRSNb (ORCPT ); Thu, 18 Apr 2019 14:13:31 -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 7E9B520652; Thu, 18 Apr 2019 18:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611210; bh=Jfe4LxnnKcdAuXGufB9/wP+WEB9MvzHvf3SaxjB/QPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rTOabPv4oqNALNcWqXzCk7XCa4DDFOLNH6Dq5ubAK7PnKFCwPfl0C8QsS7hWHomyT nIaWiEoe8pldbE5tg9f66QgUljYNi7G09GqRfFe85CyAptEkygsdAK3vez10ucxf0h 714iKyzc24vHjUMSM9Gr8k/hLDupnAm5mcxdKmEM= 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 5.0 62/93] x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error Date: Thu, 18 Apr 2019 19:57:40 +0200 Message-Id: <20190418160443.721140778@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160436.781762249@linuxfoundation.org> References: <20190418160436.781762249@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