]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
platform/x86: hp-wmi: Convert simple_strtoul() to kstrtou32()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 15 May 2020 13:27:04 +0000 (16:27 +0300)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
commit55187c89b0eb169eccd704b9a21fef1332139380
tree734163e61bd8e656dab99ca0a19a9335f319f003
parent226c4bf56ff20bf56194cb233bb2d65207a2206d
platform/x86: hp-wmi: Convert simple_strtoul() to kstrtou32()

BugLink: https://bugs.launchpad.net/bugs/1885023
[ Upstream commit 5cdc45ed3948042f0d73c6fec5ee9b59e637d0d2 ]

First of all, unsigned long can overflow u32 value on 64-bit machine.
Second, simple_strtoul() doesn't check for overflow in the input.

Convert simple_strtoul() to kstrtou32() to eliminate above issues.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/platform/x86/hp-wmi.c