mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 18:30:06 +00:00
Input: cyttsp4_core - fix use after free bug
[ Upstream commit 79aae6acbe
]
The device md->input is used after it is released. Setting the device
data to NULL is unnecessary as the device is never used again. Instead,
md->input should be assigned NULL to avoid accessing the freed memory
accidently. Besides, checking md->si against NULL is superfluous as it
points to a variable address, which cannot be NULL.
Signed-off-by: Pan Bian <bianpan2016@163.com>
Link: https://lore.kernel.org/r/1572936379-6423-1-git-send-email-bianpan2016@163.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3bbb8eec91
commit
b4827e98de
1 changed files with 0 additions and 7 deletions
|
@ -1972,11 +1972,6 @@ static int cyttsp4_mt_probe(struct cyttsp4 *cd)
|
|||
|
||||
/* get sysinfo */
|
||||
md->si = &cd->sysinfo;
|
||||
if (!md->si) {
|
||||
dev_err(dev, "%s: Fail get sysinfo pointer from core p=%p\n",
|
||||
__func__, md->si);
|
||||
goto error_get_sysinfo;
|
||||
}
|
||||
|
||||
rc = cyttsp4_setup_input_device(cd);
|
||||
if (rc)
|
||||
|
@ -1986,8 +1981,6 @@ static int cyttsp4_mt_probe(struct cyttsp4 *cd)
|
|||
|
||||
error_init_input:
|
||||
input_free_device(md->input);
|
||||
error_get_sysinfo:
|
||||
input_set_drvdata(md->input, NULL);
|
||||
error_alloc_failed:
|
||||
dev_err(dev, "%s failed.\n", __func__);
|
||||
return rc;
|
||||
|
|
Loading…
Reference in a new issue