Skip to content

Commit 09f3756

Browse files
tklauserdavem330
authored andcommitted
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: 0b8bf1b (net: dm9000: Allow instantiation using device tree) Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 85911d7 commit 09f3756

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/davicom/dm9000.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ static struct dm9000_plat_data *dm9000_parse_dt(struct device *dev)
13991399
const void *mac_addr;
14001400

14011401
if (!IS_ENABLED(CONFIG_OF) || !np)
1402-
return NULL;
1402+
return ERR_PTR(-ENXIO);
14031403

14041404
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
14051405
if (!pdata)

0 commit comments

Comments
 (0)