netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* DM9000 issue with mem resource management
@ 2008-06-05 15:42 Laurent Pinchart
  2008-06-05 17:40 ` Ben Dooks
  0 siblings, 1 reply; 6+ messages in thread
From: Laurent Pinchart @ 2008-06-05 15:42 UTC (permalink / raw)
  To: netdev; +Cc: Ben Dooks

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

Hi everybody,

I ran into a resource-related bug in the DM9000 driver.

When the platform device has only 2 resources, dm9000_probe() doesn't set 
db->irq_res, which results in a segfault when the pointer gets dereferenced 
in dm9000_open().

I tried to fix the issue, and found out that the resource management code is 
quite broken.

If I understand things correctly, specifying 3 resources makes the DM9000 
driver ioremap() the memory, while specifying 2 resources implies that the 
platform code already ioremap()ed the memory. Is that right ?

If so, why does dm9000_probe() call request_mem_region() on ioremap()ed 
memory ?

Wouldn't it also be simpler to use release_mem_region() in 
dm9000_release_board() instead of release_resource() + kfree() ?

I'd be grateful if someone could confirm my assumptions. I'll then submit a 
patch to fix those issues.

Best regards,

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-06-09 13:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-05 15:42 DM9000 issue with mem resource management Laurent Pinchart
2008-06-05 17:40 ` Ben Dooks
2008-06-06  9:01   ` Laurent Pinchart
2008-06-07 21:35     ` Ben Dooks, g
2008-06-09 13:41       ` Laurent Pinchart
2008-06-06  9:11   ` Laurent Pinchart

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).