platform/x86: huawei-wmi: check the return value of device_create_file()
stable inclusion from stable-v5.10.110 commit 956fab99ad269831a1b32c7f4b762c31ad9364fb bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=956fab99ad269831a1b32c7f4b762c31ad9364fb -------------------------------- [ Upstream commit c91a5b1c ] The function device_create_file() in huawei_wmi_battery_add() can fail, so its return value should be checked. Fixes: 355a070b ("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> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Yu Liao <liaoyu15@huawei.com> Reviewed-by:
Wei Li <liwei391@huawei.com> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment