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

Linus Torvalds
2005-12-14T05:15:56Z

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