Skip to content

Commit

Permalink
dm9000: NULL dereferences on error in probe()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Aug 2, 2014
1 parent 188b121 commit a5536e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ethernet/davicom/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a5536e1

Please sign in to comment.