From: Wen Yang <[email protected]>

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

Signed-off-by: Wen Yang <[email protected]>
Reviewed-by: Peng Hao <[email protected]>
CC: Zhao Qiang <[email protected]>
CC: "David S. Miller" <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
---
 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 7a42336..839fa77 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;
        }
 
-- 
2.9.5

Reply via email to