diff options
author | Wen Yang <wen.yang99@zte.com.cn> | 2018-12-26 11:28:30 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-05 17:37:51 +0300 |
commit | a6082b56e9eddfc23e432ff63fc092413992d2d2 (patch) | |
tree | 660b5f0159fb087248afebec6ed25b0d4c646c67 | |
parent | 709f50b180528ad1e89d9a8ad59cc81a85937bb8 (diff) | |
download | linux-a6082b56e9eddfc23e432ff63fc092413992d2d2.tar.xz |
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>
-rw-r--r-- | drivers/net/wan/fsl_ucc_hdlc.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c index 18b648648adb..289dff262948 100644 --- a/drivers/net/wan/fsl_ucc_hdlc.c +++ b/drivers/net/wan/fsl_ucc_hdlc.c @@ -1114,7 +1114,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; } |