dm9000: NULL dereferences on error in probe()
Subsystems (3)
PATCH 1/1 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 <[email protected]>
---
Old bug, but not serious.
drivers/net/ethernet/davicom/dm9000.c +4 -2
@@ -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); }
From: Dan Carpenter <[email protected]>
Date: Fri, 1 Aug 2014 11:23:57 +0300
Quoted 4 lines
The
dm9000_release_board()function is called with NULL ->data_req and ->addr_req pointers ifdm9000_probe()fails.Signed-off-by Dan Carpenter <[email protected]>
Applied to net-next, thanks Dan.