Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753389AbdG2Gry (ORCPT ); Sat, 29 Jul 2017 02:47:54 -0400 Received: from mail.skyhub.de ([5.9.137.197]:47028 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbdG2Grw (ORCPT ); Sat, 29 Jul 2017 02:47:52 -0400 Date: Sat, 29 Jul 2017 08:47:15 +0200 From: Borislav Petkov To: "Kani, Toshimitsu" Cc: "linux-edac@vger.kernel.org" , "mchehab@infradead.org" , "linux-kernel@vger.kernel.org" , "tony.luck@intel.com" , "rjw@rjwysocki.net" Subject: Re: [PATCH 3/3] EDAC, ghes: Make it a proper module Message-ID: <20170729064715.GB30603@nazgul.tnic> References: <20170726084827.11447-1-bp@alien8.de> <20170726084827.11447-4-bp@alien8.de> <1501267290.2042.89.camel@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1501267290.2042.89.camel@hpe.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1416 Lines: 51 On Fri, Jul 28, 2017 at 06:50:56PM +0000, Kani, Toshimitsu wrote: > This simply sets NULL to pvt, and does not initialize ghes_pvt. Yeah, I guess we need this ontop: --- diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c index ecd34b8bd27e..e158bf4ee337 100644 --- a/drivers/edac/ghes_edac.c +++ b/drivers/edac/ghes_edac.c @@ -422,7 +422,6 @@ static const char * const super_crap_msg = static int __init ghes_edac_register(void) { - struct ghes_edac_pvt *pvt = ghes_pvt; bool fake = false; int rc, num_dimm = 0; struct mem_ctl_info *mci; @@ -446,15 +445,15 @@ static int __init ghes_edac_register(void) * We need to serialize edac_mc_alloc() and edac_mc_add_mc(), * to avoid duplicated memory controller numbers */ - mci = edac_mc_alloc(1, ARRAY_SIZE(layers), layers, sizeof(*pvt)); + mci = edac_mc_alloc(1, ARRAY_SIZE(layers), layers, sizeof(struct ghes_edac_pvt)); if (!mci) { edac_pr_err("Can't allocate memory for EDAC data\n"); return -ENOMEM; } - pvt = mci->pvt_info; - memset(pvt, 0, sizeof(*pvt)); - pvt->mci = mci; + ghes_pvt = mci->pvt_info; + memset(ghes_pvt, 0, sizeof(struct ghes_edac_pvt)); + ghes_pvt->mci = mci; mci->pdev = &dummy_dev; --- > As Mauro pointed out, some type of GHES check needs to be in place > before making this change. Your whitelist I guess. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --