netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix dm9000 release_resource
@ 2006-08-30  7:04 Dirk Opfer
  2006-08-31  9:39 ` Ben Dooks
  2006-09-06 14:58 ` Jeff Garzik
  0 siblings, 2 replies; 6+ messages in thread
From: Dirk Opfer @ 2006-08-30  7:04 UTC (permalink / raw)
  To: netdev; +Cc: Ben Dooks, Sascha Hauer

[-- Attachment #1: Type: text/plain, Size: 519 bytes --]

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>

[-- Attachment #2: dm9000-fix-release-ressource.patch --]
[-- Type: application/octet-stream, Size: 393 bytes --]

diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 3d76fa1..a860ebb 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -377,8 +377,8 @@ dm9000_release_board(struct platform_dev
 		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);
 	}
 }

^ permalink raw reply related	[flat|nested] 6+ messages in thread
[parent not found: <0ML25U-1GIK8C13Mq-0007lB@mrelayeu.kundenserver.de>]

end of thread, other threads:[~2006-09-11 13:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-30  7:04 [PATCH] Fix dm9000 release_resource Dirk Opfer
2006-08-31  9:39 ` Ben Dooks
2006-09-06 14:58 ` Jeff Garzik
2006-09-06 17:53   ` Dirk Opfer
2006-09-11 13:08     ` Jeff Garzik
     [not found] <0ML25U-1GIK8C13Mq-0007lB@mrelayeu.kundenserver.de>
2006-08-31  7:32 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).