diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2014-09-19 16:16:25 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-22 16:02:34 -0400 |
commit | 09f3756bb9a82835b0c2a9b50f36b47aa42f2c61 (patch) | |
tree | 42e42132481b8a3f11e4908a31e27878226361b3 | |
parent | 85911d71109d3dda8bb35515b78bcc1de6837785 (diff) |
dm9000: Return an ERR_PTR() in all error conditions of dm9000_parse_dt()
In one error condition dm9000_parse_dt() returns NULL, however the
return value is checked using IS_ERR() in dm9000_probe(), leading to the
error not being properly propagated if CONFIG_OF is not enabled or the
device tree data is not available. Fix this by also returning an
ERR_PTR() in this case.
Fixes: 0b8bf1baabe5 (net: dm9000: Allow instantiation using device tree)
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/davicom/dm9000.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 9b33057a9477..70089c29d307 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c @@ -1399,7 +1399,7 @@ static struct dm9000_plat_data *dm9000_parse_dt(struct device *dev) const void *mac_addr; if (!IS_ENABLED(CONFIG_OF) || !np) - return NULL; + return ERR_PTR(-ENXIO); pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) |