Skip to content
Commit 5025224f authored by Siarhei Yasinski's avatar Siarhei Yasinski Committed by Peng Fan
Browse files

net: enetc: Fix use after free issue in fsl_enetc.c



If ethernet connected to SFP, like this:

&enetc_port0 {
            phy-connection-type = "sgmii";
            sfp = <&sfp0>;
            managed = "in-band-status";
            status = "okay";
};

Then enetc_config_phy returns -ENODEV and the memory containing the mdio interface is freed.
It's better to unregister and free mdio resources.

Signed-off-by: default avatarSiarhei Yasinski <siarhei.yasinski@sintecs.eu>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarRamon Fried <rfried.dev@gmail.com>
Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
parent 6f6fbb33
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment