]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tty: vcc: Add check for kstrdup() in vcc_probe()
authorYi Yang <yiyang13@huawei.com>
Mon, 4 Sep 2023 03:52:20 +0000 (11:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 16:45:44 +0000 (16:45 +0000)
commit38cd56fc9de78bf3c878790785e8c231116ef9d3
tree04e463b5f12427e567cb58f66c2ddf3cf6c03ab3
parent930f0aaba4820d6362de4e6ed569eaf444f1ea4e
tty: vcc: Add check for kstrdup() in vcc_probe()

[ Upstream commit d81ffb87aaa75f842cd7aa57091810353755b3e6 ]

Add check for the return value of kstrdup() and return the error, if it
fails in order to avoid NULL pointer dereference.

Signed-off-by: Yi Yang <yiyang13@huawei.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230904035220.48164-1-yiyang13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/vcc.c