Revision d81916910f7498fe7a768697e0101d488f9fe665 authored by Yang Yingliang on 29 October 2022, 08:29:31 UTC, committed by Huacai Chen on 29 October 2022, 08:29:31 UTC
Currently the return value of 'sub_driver->init' is not checked. If
sparse_keymap_setup() called in the init function fails, 'generic_
inputdev' is freed, then it will lead a UAF when using it in generic_
acpi_laptop_init(). Fix it by checking the return value and setting
generic_inputdev to NULL after free, so as to avoid double free it.

The error code in generic_subdriver_init() is always negative, so the
return of generic_subdriver_init() can be simplified.

Fixes: 6246ed09111f ("LoongArch: Add ACPI-based generic laptop driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent fbe605a
History
File Mode Size
Makefile -rw-r--r-- 588 bytes
emu10k1.c -rw-r--r-- 7.5 KB
emu10k1_callback.c -rw-r--r-- 13.6 KB
emu10k1_main.c -rw-r--r-- 67.6 KB
emu10k1_patch.c -rw-r--r-- 5.4 KB
emu10k1_synth.c -rw-r--r-- 2.4 KB
emu10k1_synth_local.h -rw-r--r-- 846 bytes
emu10k1x.c -rw-r--r-- 45.5 KB
emufx.c -rw-r--r-- 100.2 KB
emumixer.c -rw-r--r-- 66.9 KB
emumpu401.c -rw-r--r-- 10.5 KB
emupcm.c -rw-r--r-- 55.9 KB
emuproc.c -rw-r--r-- 19.1 KB
io.c -rw-r--r-- 15.1 KB
irq.c -rw-r--r-- 5.9 KB
memory.c -rw-r--r-- 16.6 KB
p16v.c -rw-r--r-- 26.3 KB
p16v.h -rw-r--r-- 13.9 KB
p17v.h -rw-r--r-- 7.5 KB
timer.c -rw-r--r-- 2.0 KB
tina2.h -rw-r--r-- 769 bytes
voice.c -rw-r--r-- 3.9 KB

back to top