2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-20 00:26:39 +08:00

[PATCH] Fix dm9000 release_resource

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>
This commit is contained in:
Dirk Opfer 2006-09-06 19:53:32 +02:00 committed by Jeff Garzik
parent 38f5745c5a
commit 519854876c

View File

@ -377,8 +377,8 @@ dm9000_release_board(struct platform_device *pdev, struct board_info *db)
kfree(db->data_req); kfree(db->data_req);
} }
if (db->addr_res != NULL) { if (db->addr_req != NULL) {
release_resource(db->addr_res); release_resource(db->addr_req);
kfree(db->addr_req); kfree(db->addr_req);
} }
} }