ACPI: thinkpad-acpi: don't misdetect in get_thinkpad_model_data() on -ENOMEM
commit4efd24962e6155726cab5ceeec51843bf9c1bbb0
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 19 Oct 2008 21:00:07 +0000 (19 19:00 -0200)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 19 Oct 2008 21:00:07 +0000 (19 19:00 -0200)
tree4df67971c62fafd6652a99822aa14f3f0ddcbb30
parent820411c711bc574a3e5caf2580694008e6c51b4e
ACPI: thinkpad-acpi: don't misdetect in get_thinkpad_model_data() on -ENOMEM

Explicitly check for memory allocation failures, and return status to
indicate that we could not collect data due to errors.

This lets the driver have a far more predictable failure mode on ENOMEM in
that codepath: it will refuse to load.  This is far better than trying to
proceed with missing data which is used to detect quirks, etc.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
drivers/misc/thinkpad_acpi.c