Skip to content

Commit

Permalink
[PATCH] Fix dm9000 release_resource
Browse files Browse the repository at this point in the history
dm9000_release_board calls release_resource with the platform resource
instead of the requested resource:

db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
db->addr_req = request_mem_region(db->addr_res->start, i, pdev->name);

dm9000_release_board:

if (db->addr_res != NULL) {
release_resource(db->addr_res);
kfree(db->addr_req);

With this behavior the kernel will crash on the second removal. The
attached patch fix this problem.

Signed-off-by: Dirk Opfer <Dirk@Opfer-Online.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Dirk Opfer authored and Jeff Garzik committed Sep 11, 2006
1 parent 38f5745 commit 5198548
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/dm9000.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ dm9000_release_board(struct platform_device *pdev, struct board_info *db)
kfree(db->data_req);
}

if (db->addr_res != NULL) {
release_resource(db->addr_res);
if (db->addr_req != NULL) {
release_resource(db->addr_req);
kfree(db->addr_req);
}
}
Expand Down

0 comments on commit 5198548

Please sign in to comment.