ACPI: LPSS: Use kstrtol() instead of simple_strtol()
authorLiu Shixin <liushixin2@huawei.com>
Thu, 3 Jun 2021 09:12:04 +0000 (17:12 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 7 Jun 2021 14:12:32 +0000 (16:12 +0200)
commit8e3ecc68e33ffe3a168f765a8f07377258615709
tree50c71018c26095c3cb92fb68747b8287a4a2ab6c
parent614124bea77e452aa6df7a8714e8bc820b489922
ACPI: LPSS: Use kstrtol() instead of simple_strtol()

The simple_strtol() function is not reliable in some situation, since
it does not check for the range overflow. Use kstrtol() instead.

While at it, modify the code to avoid evaluating _SEM unnecessarily
if uid_str is NULL or kstrtol() fails to convert that string to a
nonzero number.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
[ rjw: Check uid right after calling kstrtol() ]
[ rjw: Rewrite subject and changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_lpss.c