tty: serial: 8250: serial_cs: Fix a memory leak in error handling path
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 25 May 2021 19:44:04 +0000 (21:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:05:40 +0000 (16:05 +0200)
commit7a80f71601af015856a0aeb1e3c294037ac3dd32
tree10f6e4668d39b83061f0a76bf9dc7a8707ce8257
parent75452cc776683bda53380ade8a2c42371e136ed0
tty: serial: 8250: serial_cs: Fix a memory leak in error handling path

[ Upstream commit fad92b11047a748c996ebd6cfb164a63814eeb2e ]

In the probe function, if the final 'serial_config()' fails, 'info' is
leaking.

Add a resource handling path to free this memory.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/dc25f96b7faebf42e60fe8d02963c941cf4d8124.1621971720.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/8250/serial_cs.c