]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc
authorZhang Lixu <lixu.zhang@intel.com>
Wed, 6 Mar 2024 00:44:04 +0000 (00:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 May 2024 14:32:30 +0000 (16:32 +0200)
commitb7e3f0cbe1d79829497d82a9d4b86f9dca0b4b30
tree47a8fffeb75111e962aa0158457c7d97465050f7
parentfc1860a1bf6cf0caae4d92ba14c7d99260852db4
HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc

[ Upstream commit 92826905ae340b7f2b25759a06c8c60bfc476b9f ]

The variable dev->devc in ish_dev_init was utilized by dev_err before it
was properly assigned. To rectify this, the assignment of dev->devc has
been moved to immediately follow memory allocation.

Without this change "(NULL device *)" is printed for device information.

Fixes: 8ae2f2b0a284 ("HID: intel-ish-hid: ipc: Fix potential use-after-free in work function")
Fixes: ae02e5d40d5f ("HID: intel-ish-hid: ipc layer")
Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/intel-ish-hid/ipc/ipc.c