From: Wen Yang Date: Wed, 26 Dec 2018 08:28:30 +0000 (+0800) Subject: net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe() X-Git-Tag: Ubuntu-5.10.0-12.13~6263^2~29 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=40752b3eae29f8ca2378e978a02bd6dbeeb06d16;p=mirror_ubuntu-hirsute-kernel.git net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe() This patch fixes potential double frees if register_hdlc_device() fails. Signed-off-by: Wen Yang Reviewed-by: Peng Hao CC: Zhao Qiang CC: "David S. Miller" CC: netdev@vger.kernel.org CC: linuxppc-dev@lists.ozlabs.org CC: linux-kernel@vger.kernel.org Signed-off-by: David S. Miller --- diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c index 7a42336c8af8..839fa7715709 100644 --- a/drivers/net/wan/fsl_ucc_hdlc.c +++ b/drivers/net/wan/fsl_ucc_hdlc.c @@ -1180,7 +1180,6 @@ static int ucc_hdlc_probe(struct platform_device *pdev) if (register_hdlc_device(dev)) { ret = -ENOBUFS; pr_err("ucc_hdlc: unable to register hdlc device\n"); - free_netdev(dev); goto free_dev; }