Received: by 10.223.164.202 with SMTP id h10csp217759wrb; Mon, 13 Nov 2017 05:26:56 -0800 (PST) X-Google-Smtp-Source: AGs4zMa5BTngkMqokRMN8RZJEkJ/sjPrBq90B98TscjqnjBNrwENOa1ltaOTo3/mSPDDS4hBCa3Z X-Received: by 10.98.215.66 with SMTP id v2mr9752766pfl.24.1510579616464; Mon, 13 Nov 2017 05:26:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510579616; cv=none; d=google.com; s=arc-20160816; b=TH+ffp2IbKlGSlRkW19jRmuzioMP2/bUqEN/H5g1dlvnmzi2eFZi5ztu1mxdWjeyv+ zPi/7j0ive8/xYhMZyfSM4eJaNddGEWbEyZUrpj2FriaCsCs4P/F6jNfnQJglItFU3sU jisoEmGPvITA/8Vle885dEcxk5rstigPCNMSpmQYKDz0vHt8VR7pYkKt2brzGbgOWWK1 Nx8pH1SOr1zOPdxPY2B/hnANzjEpIzIuH5f6WuHhpmDlJyzNN2s6vphzLnkCkOLUzVsP 9kLU/EsBzGV4Nku6Duz94gWkZWc0qAwmVIjnO8Mj/Ar2hE7F+e+FDYz/QbS8AKAeO5Zx QQCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=63jACAg5dl4Qf3NJixV7PZgx9sBTNT9tWB445gqf1mk=; b=DROzBHjyHLpL8Hn5hgjKU6QydY4szkcvwuxpl80QBm4+IWwIlxU6cv4Tu63uVdnj2p +lOpU7ESfZX35H04LalOx4ZQNpBPZzSlkVrdAgqfTaogcE3JWMoXTM/tbEAbv8y1Wny5 BuRdn/jac6l6w8uCqh+bH5xctekHUf37+IgK5KDJgcEEzh28zyg8af/6ujZLPAolWOL3 thyludfpUj9JJDkuzgPF9e/zjpYljIYoXMFzgOrK8B3tNS1hx76jkNtpzgLBsbQkf9Ps kA8p2caYrMyUwnUxdFmEd7N2mBeUioya0PjEAmk1j+A3GxoK9rQW7Cs2B3aJmv1hnzYQ aVng== ARC-Authentication-Results: i=1; mx.google.com; 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 p20si3400421pgc.387.2017.11.13.05.26.43; Mon, 13 Nov 2017 05:26:56 -0800 (PST) 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; 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 S1754504AbdKMNZB (ORCPT + 95 others); Mon, 13 Nov 2017 08:25:01 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:49978 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754307AbdKMNA3 (ORCPT ); Mon, 13 Nov 2017 08:00:29 -0500 Received: from localhost (LFbn-1-12253-150.w90-92.abo.wanadoo.fr [90.92.67.150]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 406F0AA5; Mon, 13 Nov 2017 13:00:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yazen Ghannam , linux-edac , Borislav Petkov , Sasha Levin Subject: [PATCH 4.9 08/87] EDAC, amd64: Add x86cpuid sanity check during init Date: Mon, 13 Nov 2017 13:55:25 +0100 Message-Id: <20171113125616.048500857@linuxfoundation.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171113125615.304035578@linuxfoundation.org> References: <20171113125615.304035578@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yazen Ghannam [ Upstream commit 1bd9900b8301fc505f032c90ea487824cf824e99 ] Match one of the devices in amd64_cpuids[] before loading the module. This is an additional sanity check against users trying to load amd64_edac_mod on unsupported systems. Signed-off-by: Yazen Ghannam Cc: linux-edac Link: http://lkml.kernel.org/r/1485537863-2707-9-git-send-email-Yazen.Ghannam@amd.com [ Get rid of err_ret label, make it a bit more readable this way. ] Signed-off-by: Borislav Petkov Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/edac/amd64_edac.c | 6 ++++-- drivers/edac/amd64_edac.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -2984,8 +2984,11 @@ static int __init amd64_edac_init(void) int err = -ENODEV; int i; + if (!x86_match_cpu(amd64_cpuids)) + return -ENODEV; + if (amd_cache_northbridges() < 0) - goto err_ret; + return -ENODEV; opstate_init(); @@ -3025,7 +3028,6 @@ err_free: kfree(ecc_stngs); ecc_stngs = NULL; -err_ret: return err; } --- a/drivers/edac/amd64_edac.h +++ b/drivers/edac/amd64_edac.h @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "edac_core.h" #include "mce_amd.h" From 1584123209633553968@xxx Wed Nov 15 09:20:19 +0000 2017 X-GM-THRID: 1584123209633553968 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread