net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe()
authorWen Yang <wen.yang99@zte.com.cn>
Wed, 26 Dec 2018 08:28:30 +0000 (16:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:20:56 +0000 (09:20 +0100)
commitdf427cac8469c58791cdd8c0d5ef6e625b9300ec
treec54cce6f77e09bac25b0690f9ea2b290ae301748
parente3a5ee138296040393c7d230ede7d1ddf2a661dc
net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe()

[ Upstream commit 40752b3eae29f8ca2378e978a02bd6dbeeb06d16 ]

This patch fixes potential double frees if register_hdlc_device() fails.

Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Reviewed-by: Peng Hao <peng.hao2@zte.com.cn>
CC: Zhao Qiang <qiang.zhao@nxp.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: netdev@vger.kernel.org
CC: linuxppc-dev@lists.ozlabs.org
CC: linux-kernel@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wan/fsl_ucc_hdlc.c