Commit 4df9f5e3 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Ramon Fried
Browse files

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: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
parent 19ef59f1
......@@ -21,7 +21,7 @@ identifier readfunc, writefunc;
+ mdiodev->write = writefunc;
+
+ retval = mdio_register(mdiodev);
+ if (retval < 0) return retval;
+ if (retval < 0) { mdio_free(mdiodev); return retval; }
@ update_read_sig @
identifier mii_reg.readfunc;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment