Re: [PATCH] Fix oops in asus_acpi.c on Samsung P30/P35 Laptops

From: Linus Torvalds
Date: Wed Dec 14 2005 - 00:20:35 EST




On Wed, 14 Dec 2005, Carl-Daniel Hailfinger wrote:
>
> The patch has been tested and verified, is shipped in the
> SUSE 10.0 kernel and does not cause any regressions.

I'd be _much_ happier if

- the patch wasn't totally whitespace-damaged (your mailer seems
to not only remove spaces at the end of lines, it _also_ adds them to
the beginning when there was another space there, as far as I can tell)

Being right "on average" thanks to having two different bugs does not a
good mailer make.

- you were to separate out the oops-fixing code from the code that adds
handling for that (strange?) model type logic.

It seems that the _oops_ is because the later paths just assume that
it's a ACPI_TYPE_STRING and will dereference "model->string.pointer"
regardless of whether that is true or not. And you add a test for
ACPI_TYPE_INTEGER, however, you do _not_ fix the oops for any other
type, so the exact _same_ bug is still waiting to happen if there is
some other strange ACPI table entry some day.

So I think the proper fix is to _first_ just do something like

if (model->type != ACPI_TYPE_STRING)
goto unknown;

which should fix the oops (no?), and then handling ACPI_TYPE_INTEGER above
that as one case would be a separate patch.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/