Re: [PATCH] Fix dm9000 release_resource

2006-08-31 Thread Sascha Hauer
On Wed, Aug 30, 2006 at 09:04:45AM +0200, Dirk Opfer wrote:
> 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 <[EMAIL PROTECTED]>

I thought this was fixed long ago, it must have been lost somewhere.
Anyway:

Acked-by: Sascha Hauer <[EMAIL PROTECTED]>



-- 
 Dipl.-Ing. Sascha Hauer | http://www.pengutronix.de
  Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
  Hannoversche Str. 2, 31134 Hildesheim, Germany
Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Fix dm9000 release_resource

2006-08-31 Thread Ben Dooks
On Wed, Aug 30, 2006 at 09:04:45AM +0200, Dirk Opfer wrote:
> 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 <[EMAIL PROTECTED]>
Acked-by: Ben Dooks <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Fix dm9000 release_resource

2006-09-06 Thread Jeff Garzik

Dirk Opfer wrote:

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 <[EMAIL PROTECTED]>


Your patch is attached base64-encoded, which makes it impossible to 
comment on it inline.


Jeff


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Fix dm9000 release_resource

2006-09-06 Thread Dirk Opfer
Jeff Garzik schrieb:
>
> Your patch is attached base64-encoded, which makes it impossible to
> comment on it inline.
>
> Jeff
>
>
Sorry for that. I send this via webclient.

Here is another attempt.

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 <[EMAIL PROTECTED]>


Dirk
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);
}
 }


Re: [PATCH] Fix dm9000 release_resource

2006-09-11 Thread Jeff Garzik

applied

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html