Commit 40752b3e authored by Wen Yang's avatar Wen Yang Committed by David S. Miller

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: default avatarWen Yang <wen.yang99@zte.com.cn>
Reviewed-by: default avatarPeng 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: default avatarDavid S. Miller <davem@davemloft.net>
parent 92ee77d1
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment