ACPI: thinkpad-acpi: don't misdetect in get_thinkpad_model_data() on -ENOMEM
commit625821b5237b2d5160992e9cbef115decc7394f8
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 11 Nov 2008 01:46:30 +0000 (10 23:46 -0200)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Tue, 11 Nov 2008 01:46:30 +0000 (10 23:46 -0200)
tree067ab060c13c9d78e67797ef6d1d6c2b1d6f1246
parentd34a1f3c5cd998d01b7042e522c1537902c9c260
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