diff options
author | Oleksij Rempel <o.rempel@pengutronix.de> | 2021-04-29 13:08:33 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-30 00:54:35 +0200 |
commit | d4eecfb28b963493a8701f271789ff04e92ae205 (patch) | |
tree | 404945eafbfc36baae0c7a4c616dca0d35f43d6a /drivers/net/dsa/microchip | |
parent | net: dsa: ksz: ksz8795_spi_probe: fix possible NULL pointer dereference (diff) | |
download | linux-d4eecfb28b963493a8701f271789ff04e92ae205.tar.xz linux-d4eecfb28b963493a8701f271789ff04e92ae205.zip |
net: dsa: ksz: ksz8863_smi_probe: set proper return value for ksz_switch_alloc()
ksz_switch_alloc() will return NULL only if allocation is failed. So,
the proper return value is -ENOMEM.
Fixes: 60a364760002 ("net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/microchip')
-rw-r--r-- | drivers/net/dsa/microchip/ksz8863_smi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/microchip/ksz8863_smi.c b/drivers/net/dsa/microchip/ksz8863_smi.c index 9fb38e99001a..11293485138c 100644 --- a/drivers/net/dsa/microchip/ksz8863_smi.c +++ b/drivers/net/dsa/microchip/ksz8863_smi.c @@ -154,7 +154,7 @@ static int ksz8863_smi_probe(struct mdio_device *mdiodev) dev = ksz_switch_alloc(&mdiodev->dev, ksz8); if (!dev) - return -EINVAL; + return -ENOMEM; for (i = 0; i < ARRAY_SIZE(ksz8863_regmap_config); i++) { rc = ksz8863_regmap_config[i]; |