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

Borislav Petkov
2011-03-05T12:56:46Z

On Fri, Mar 04, 2011 at 04:07:21PM -0500, Johan Wessfeldt wrote:
> On Fri, Mar 4, 2011 at 6:16 PM, Borislav Petkov <bp@amd64.org> wrote:

..

> > Anyway, while this is makes sense from correctness POV, if we hit an
> > error path here this early then something else is going terribly wrong
> > which would've screamed very loudly already. Are you hitting this on a
> > real workload or you caught this by code staring?
> The orginal patch was made with the intention of auditing the code
> according to the kernel-janitors TODO list:
> http://kernelnewbies.org/KernelJanitors/Todo/ReturnCodes .
>
> To clear things up. I originally posted a minor patch, which basically passed
> the return value from misc_register up the stack. See
> http://marc.info/?l=linux-kernel&m=129889198732342&w=2

I see what you're doing and I think it is great that you're trying to
audit the code - this is actually very commendable but I'm questioning
whether such a "fix" makes sense in this case. As I said above, if we
hit those error paths, then we definitely botched up something else big
time and recovering here is pretty moot at this point. Therefore, adding
a bunch of code which is almost never executed is simply unneeded.

HTH.

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632