mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* I can loop dev_base only once. Why?
@ 2001-10-12 14:52 Kirill Ratkin
  0 siblings, 0 replies; only message in thread
From: Kirill Ratkin @ 2001-10-12 14:52 UTC (permalink / raw)
  To: linux-kernel

Hi. I have a problem.

I write module which scans network device list. 
I made:

int init(void)
{
  struct net_device *dev, **dp;

  printk("<1>Ok\n");
  while ((dev = *dp) != NULL) {
    printk("<1>Searching ...\n"); 
    write_lock_bh(&dev_base_lock);

    /* ... here I change one fileld ... */

    *dp = dev->next;
    write_unlock_bh(&dev_base_lock);
  }
  return 0;
}

void cleanup(void)
{
  while ((dev = *dp) != NULL) {
    write_lock_bh(&dev_base_lock);

    /* ... here turn change back  ... */

   *dp = dev->next;
   write_unlock_bh(&dev_base_lock);
 }
}

The problem:
This code works only once. Then I remove module and
start it again I see only 'Ok' string. Could you
explain me where is problem?

Regards,
Kirill.

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-10-12 14:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-12 14:52 I can loop dev_base only once. Why? Kirill Ratkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®