Hi!

I'm working for pentamedia in Korea.
My company makes one-way satellite receiver card whose name is pentavalue.
Pentavalue cards receive DVB-S packets and extract IP packets and
push them into TCP/IP stack.
pentavalue driver works in linux kernel 2.4.20.
I'm porting pentavalue driver to 2.6.17 kernel, but reference count problem occurs.
There is no code updating reference count in driver source.
I insert debug code in kernel source at dev_put and dev_hold
in include/linux/netdevice.h file.
static inline void dev_put(struct net_device *dev)
{
        atomic_dec(&dev->refcnt);
+        if (*(dev)->name=='p') {
+                printk("-%s- %d\n",dev->name,atomic_read(&dev->refcnt));
+                dump_stack();
+        }
}

static inline void dev_hold(struct net_device *dev)
{
        atomic_inc(&dev->refcnt);
+        if (*(dev)->name=='p') {
+                printk("+%s+ %d\n",dev->name,atomic_read(&dev->refcnt));
+                dump_stack();
+        }
}

I found ipv6 module notifier increase refcnt and not decrease refcnt.
refcnt increases by 3 when the device opens and closes using ifconfig.
I modified driver source for enabling rmmod by setting refcnt to 4 before cleanup module. I will attach command log file.

Attachment: pentaval.log
Description: Binary data

Reply via email to