Re: [PATCH 1/1] x86: Fix mcheck_init_device() to handle misc_register() correctly

Dan Carpenter
2011-03-04T18:25:39Z

On Fri, Mar 04, 2011 at 01:29:27PM +0000, J.P. Lacerda wrote:
> The return value for misc_register() was not being taken into account.
> Furthermore, if misc_register() fails, we must rollback any changes made by
> mcheck_init_device()
>
> Signed-off-by: J.P. Lacerda <jp.lacerda@codethink.co.uk>

Ah... You found a bug that Johan missed in his original patch. But you
still left out the case where mce_create_device() can fail which his
patch addressed. Also his patch was nicer; using gotos to unwind is
the standard way for kernel error handling.

Also why did you poach his patch without giving any kind of credit,
instead of just telling him about the bug??? WTF?

Johan, please fix add a free_cpumask_var(mce_dev_initialized); to your
patch. Call it [PATCH v2]. Add in the changelog that J.P. Lacerda
told you about the missing free_cpumask_var(mce_dev_initialized).

regards,
dan carpenter