mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Borislav Petkov <bp@alien8.de>
Cc: "Luck, Tony" <tony.luck@intel.com>,
	Markus Trippelsdorf <markus@trippelsdorf.de>,
	Ming Lei <tom.leiming@gmail.com>, Linda Walsh <lkml@tlinx.org>,
	Linux-Kernel <linux-kernel@vger.kernel.org>,
	Doug Thompson <dougthompson@xmission.com>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Subject: Re: BUG: key ffff880c1148c478 not in .data! (V3.10.0)
Date: Sat, 20 Jul 2013 05:55:44 +0300	[thread overview]
Message-ID: <20130720055544.73a7315d.mchehab@infradead.org> (raw)
In-Reply-To: <20130718232718.GA14824@pd.tnic>

Em Fri, 19 Jul 2013 01:27:18 +0200
Borislav Petkov <bp@alien8.de> escreveu:

> On Thu, Jul 18, 2013 at 04:51:48PM +0000, Luck, Tony wrote:
> > +	BUG_ON(mci->mc_idx >= EDAC_MAX_MCS);
> > 
> > Do we have to "BUG_ON()" here?  Couldn't we be gentler with something like:
> > 
> > 	if (mci->mc_idx >= EDAC_MAX_MCS) {
> > 		printk_once(KERN_WARNING "Too many memory controllers\n");
> > 		return; /* probably need to make sure caller copes with this ... so more stuff there */
> 
> Yeah, we can do something like this:

With this change, the patch looks ok for me.

Acked-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> 
> diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
> index 429e971e02d7..c55ad285c285 100644
> --- a/drivers/edac/edac_mc.c
> +++ b/drivers/edac/edac_mc.c
> @@ -725,6 +725,11 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)
>  	int ret = -EINVAL;
>  	edac_dbg(0, "\n");
>  
> +	if (mci->mc_idx >= EDAC_MAX_MCS) {
> +		pr_warn_once("Too many memory controllers: %d\n", mci->mc_idx);
> +		return ret;
> +	}
> +
>  #ifdef CONFIG_EDAC_DEBUG
>  	if (edac_debug_level >= 3)
>  		edac_mc_dump_mci(mci);
> --
> 
> right near the beginning of the function so that we can save us the
> unwinding.
> 




Cheers,
Mauro

  parent reply	other threads:[~2013-07-20  2:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-07 22:25 Fwd: " Linda Walsh
2013-07-12  2:19 ` Ming Lei
2013-07-12  8:04   ` Markus Trippelsdorf
2013-07-12 13:41     ` Borislav Petkov
2013-07-12 13:57       ` Mauro Carvalho Chehab
2013-07-12 14:21         ` Borislav Petkov
2013-07-12 16:13           ` Mauro Carvalho Chehab
2013-07-12 16:19             ` Luck, Tony
2013-07-18 16:42               ` Borislav Petkov
2013-07-18 16:51                 ` Luck, Tony
2013-07-18 23:27                   ` Borislav Petkov
2013-07-19 10:28                     ` [PATCH -v2] EDAC: Fix lockdep splat Borislav Petkov
2013-07-20  3:55                       ` Mauro Carvalho Chehab
2013-07-20  2:55                     ` Mauro Carvalho Chehab [this message]
2013-07-12 14:28       ` BUG: key ffff880c1148c478 not in .data! (V3.10.0) Markus Trippelsdorf
2013-07-12 14:36         ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130720055544.73a7315d.mchehab@infradead.org \
    --to=mchehab@infradead.org \
    --cc=bp@alien8.de \
    --cc=dougthompson@xmission.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@tlinx.org \
    --cc=markus@trippelsdorf.de \
    --cc=tom.leiming@gmail.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®