diff options
author | Dirk Opfer <Dirk@Opfer-Online.de> | 2006-09-06 13:53:32 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-11 09:08:38 -0400 |
commit | 519854876c66bd04b0c12d3cead6e0e5fc5a1167 (patch) | |
tree | a76da09513b838d6ccd41545ba6f5f9f328acf46 /drivers | |
parent | 38f5745c5a90641079fd5b48600ae63f7ab6edcd (diff) |
[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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/dm9000.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 3d76fa144c4f..a860ebbbf815 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -377,8 +377,8 @@ dm9000_release_board(struct platform_device *pdev, struct board_info *db) | |||
377 | kfree(db->data_req); | 377 | kfree(db->data_req); |
378 | } | 378 | } |
379 | 379 | ||
380 | if (db->addr_res != NULL) { | 380 | if (db->addr_req != NULL) { |
381 | release_resource(db->addr_res); | 381 | release_resource(db->addr_req); |
382 | kfree(db->addr_req); | 382 | kfree(db->addr_req); |
383 | } | 383 | } |
384 | } | 384 | } |