Hi all,

I found that sunhme.c doesn't check ioremap() return value and doesn't
call iounmap() on module unload. Attached patch (for 2.4.1-ac20) should fix it, 
compiles clearly, but untested (I have no such hardware).

Best regards.

-- 
Andrey Panin            | Embedded systems software engineer
[EMAIL PROTECTED]        | PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc
diff -ur linux.vanilla/drivers/net/sunhme.c linux/drivers/net/sunhme.c
--- linux.vanilla/drivers/net/sunhme.c  Thu Feb 22 20:50:00 2001
+++ linux/drivers/net/sunhme.c  Thu Feb 22 22:00:43 2001
@@ -2856,7 +2856,10 @@
                printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base 
address.\n");
                return -ENODEV;
        }
-       hpreg_base = (unsigned long) ioremap(hpreg_base, 0x8000);
+       if ((hpreg_base = (unsigned long) ioremap(hpreg_base, 0x8000)) == 0) {
+               printk(KERN_ERR "happymeal(PCI): Unable to remap card memory.\n");
+               return -ENODEV;
+       }
 
        for (i = 0; i < 6; i++) {
                if (macaddr[i] != 0)
@@ -3071,6 +3074,7 @@
                                            PAGE_SIZE,
                                            hp->happy_block,
                                            hp->hblock_dvma);
+                       iounmap((void *)hp->gregs);
                }
 #endif
                unregister_netdev(hp->dev);

PGP signature

Reply via email to