mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 21:50:53 +07:00
fsl_pq_mdio: Fix mdiobus allocation handling
The driver could return success code even if mdiobus_alloc() failed. This patch fixes the issue. Signed-off-by: Anton Vorontsov <avorontsov@mvista.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a2f7922713
commit
08d18f3b62
@ -277,15 +277,17 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev,
|
||||
int tbiaddr = -1;
|
||||
const u32 *addrp;
|
||||
u64 addr = 0, size = 0;
|
||||
int err = 0;
|
||||
int err;
|
||||
|
||||
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
new_bus = mdiobus_alloc();
|
||||
if (NULL == new_bus)
|
||||
if (!new_bus) {
|
||||
err = -ENOMEM;
|
||||
goto err_free_priv;
|
||||
}
|
||||
|
||||
new_bus->name = "Freescale PowerQUICC MII Bus",
|
||||
new_bus->read = &fsl_pq_mdio_read,
|
||||
|
Loading…
Reference in New Issue
Block a user