* [bug report] net: arc_emac: Make use of the helper function dev_err_probe()
@ 2021-09-20 7:48 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-09-20 7:48 UTC (permalink / raw)
To: caihuoqing; +Cc: kernel-janitors
Hello Cai Huoqing,
The patch 95b5fc03c189: "net: arc_emac: Make use of the helper
function dev_err_probe()" from Sep 15, 2021, leads to the following
Smatch static checker warning:
drivers/net/ethernet/arc/emac_mdio.c:170 arc_mdio_probe()
error: dereferencing freed memory 'bus'
drivers/net/ethernet/arc/emac_mdio.c
164 snprintf(bus->id, MII_BUS_ID_SIZE, "%s", bus->name);
165
166 error = of_mdiobus_register(bus, priv->dev->of_node);
167 if (error) {
168 mdiobus_free(bus);
^^^
Freed
169 return dev_err_probe(priv->dev, error,
--> 170 "cannot register MDIO bus %s\n", bus->name);
^^^^^
Use after free.
171 }
172
173 return 0;
174 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-20 7:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-20 7:48 [bug report] net: arc_emac: Make use of the helper function dev_err_probe() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox