ACPI: fix create_modalias() return value handling
authorZhang Rui <rui.zhang@intel.com>
Tue, 14 Jan 2014 08:46:35 +0000 (16:46 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 16 Jan 2014 22:06:42 +0000 (23:06 +0100)
Currently, create_modalias() handles the output truncated case in
an improper way (return -EINVAL).
Plus, acpi_device_uevent() and acpi_device_modalias_show() do
improper check for the create_modalias() return value as well.

This patch fixes create_modalias() to
return -EINVAL if there is an output error,
return -ENOMEM if the output is truncated,
and also fixes both acpi_device_uevent() and acpi_device_modalias_show()
to do proper return value check.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/scan.c

Simple merge