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>
Mon, 18 Sep 2023 09:14:42 +0000 (11:14 +0200)
commitd81ffb87aaa75f842cd7aa57091810353755b3e6
tree1170f1004e81c4766035981a4f404da5aaf693a1
parent30e945861f3b46c4a5b25b861da40510a64cf9a4
tty: vcc: Add check for kstrdup() in vcc_probe()

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>
drivers/tty/vcc.c