]> 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:56:19 +0000 (16:56 +0000)
commit6c80f48912b5bd4965352d1a9a989e21743a4a06
tree231a02cf8bc36cb7ad5e1e07e970f81006c67824
parent2ff61106d6b49862786d68f5a4b971b13c6b8807
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