]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: huawei-wmi: check the return value of device_create_file()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Thu, 3 Mar 2022 02:24:21 +0000 (18:24 -0800)
committerHans de Goede <hdegoede@redhat.com>
Tue, 8 Mar 2022 15:33:15 +0000 (16:33 +0100)
commitee457f7d706d15ce3e9f47476c82267a77db2bce
tree9975e3c41415be9ceaa08c1d8a8aa4799711e8fe
parentc62a701d2da394ffd2bb947b6ac93cff192838c4
platform/x86: huawei-wmi: check the return value of device_create_file()

The function device_create_file() in huawei_wmi_battery_add() can fail,
so its return value should be checked.

Fixes: a462e8a52b8a ("platform/x86: huawei-wmi: Add battery charging thresholds")
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Link: https://lore.kernel.org/r/20220303022421.313-1-baijiaju1990@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/huawei-wmi.c