diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-08-01 11:23:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-02 15:28:23 -0700 |
commit | a5536e109453bc625461d287619f4bffe233ade9 (patch) | |
tree | e08c8a566be1f1390737e8ea09895295244682b9 | |
parent | 188b1210f3d633e27dc97309c97315ce484122ec (diff) |
dm9000: NULL dereferences on error in probe()
The dm9000_release_board() function is called with NULL ->data_req and
->addr_req pointers if dm9000_probe() fails.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/davicom/dm9000.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 13723c96d1a2..23084fb2090e 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c @@ -817,10 +817,12 @@ dm9000_release_board(struct platform_device *pdev, struct board_info *db) /* release the resources */ - release_resource(db->data_req); + if (db->data_req) + release_resource(db->data_req); kfree(db->data_req); - release_resource(db->addr_req); + if (db->addr_req) + release_resource(db->addr_req); kfree(db->addr_req); } |