[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191122060129.4239-66-sashal@kernel.org>
Date: Fri, 22 Nov 2019 01:01:05 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Wen Yang <wen.yang99@....com.cn>, Peng Hao <peng.hao2@....com.cn>,
Zhao Qiang <qiang.zhao@....com>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, Sasha Levin <sashal@...nel.org>
Subject: [PATCH AUTOSEL 4.9 67/91] net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe()
From: Wen Yang <wen.yang99@....com.cn>
[ Upstream commit 40752b3eae29f8ca2378e978a02bd6dbeeb06d16 ]
This patch fixes potential double frees if register_hdlc_device() fails.
Signed-off-by: Wen Yang <wen.yang99@....com.cn>
Reviewed-by: Peng Hao <peng.hao2@....com.cn>
CC: Zhao Qiang <qiang.zhao@....com>
CC: "David S. Miller" <davem@...emloft.net>
CC: netdev@...r.kernel.org
CC: linuxppc-dev@...ts.ozlabs.org
CC: linux-kernel@...r.kernel.org
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/net/wan/fsl_ucc_hdlc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
index 7a62316c570d2..b2c1e872d5ed5 100644
--- a/drivers/net/wan/fsl_ucc_hdlc.c
+++ b/drivers/net/wan/fsl_ucc_hdlc.c
@@ -1117,7 +1117,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;
}
--
2.20.1
Powered by blists - more mailing lists