]> git.dujemihanovic.xyz Git - u-boot.git/commit
net: enetc: Fix use after free issue in fsl_enetc.c
authorSiarhei Yasinski <siarhei.yasinski@sintecs.eu>
Wed, 31 Aug 2022 10:57:37 +0000 (10:57 +0000)
committerPeng Fan <peng.fan@nxp.com>
Tue, 6 Sep 2022 01:28:47 +0000 (09:28 +0800)
commit5025224fadc01ec2e8c50e41b765c597dfd40dba
tree1e1838d952b064781edaced24da55c27243feae3
parent6f6fbb334cc72cd5183cfe9a5b9fd31bc5d404d7
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: Siarhei Yasinski <siarhei.yasinski@sintecs.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/net/fsl_enetc.c