mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-30 16:35:37 +00:00
scripts: ensure the cocci script for miiphy_register does not leak the MDIO bus
When mdio_register fails, mdio_free should be called on the mdiodev that was previously allocated with mdio_alloc. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
This commit is contained in:
parent
19ef59f1e0
commit
4df9f5e39f
1 changed files with 1 additions and 1 deletions
|
@ -21,7 +21,7 @@ identifier readfunc, writefunc;
|
||||||
+ mdiodev->write = writefunc;
|
+ mdiodev->write = writefunc;
|
||||||
+
|
+
|
||||||
+ retval = mdio_register(mdiodev);
|
+ retval = mdio_register(mdiodev);
|
||||||
+ if (retval < 0) return retval;
|
+ if (retval < 0) { mdio_free(mdiodev); return retval; }
|
||||||
|
|
||||||
@ update_read_sig @
|
@ update_read_sig @
|
||||||
identifier mii_reg.readfunc;
|
identifier mii_reg.readfunc;
|
||||||
|
|
Loading…
Add table
Reference in a new issue