Commit a3b53563 authored by Danny Kaehn's avatar Danny Kaehn Committed by Yuan Can
Browse files

hid: cp2112: Fix duplicate workqueue initialization

stable inclusion
from stable-v4.19.299
commit 3d959406c8fff2334d83d0c352d54fd6f5b2e7cd
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9RFR6
CVE: CVE-2023-52853

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3d959406c8fff2334d83d0c352d54fd6f5b2e7cd



--------------------------------

Previously the cp2112 driver called INIT_DELAYED_WORK within
cp2112_gpio_irq_startup, resulting in duplicate initilizations of the
workqueue on subsequent IRQ startups following an initial request. This
resulted in a warning in set_work_data in workqueue.c, as well as a rare
NULL dereference within process_one_work in workqueue.c.

Initialize the workqueue within _probe instead.

Fixes: 13de9cca ("HID: cp2112: add IRQ chip handling")
Signed-off-by: default avatarDanny Kaehn <danny.kaehn@plexus.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>

Conflicts:
        drivers/hid/hid-cp2112.c
[Fix context]
Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
parent 5673bfb2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment