vserver 2.0 rc7
[linux-2.6.git] / arch / um / drivers / net_kern.c
index fe1e79a..4eeaf88 100644 (file)
@@ -383,7 +383,6 @@ static int eth_configure(int n, void *init, char *mac,
        save = lp->user[0];
        *lp = ((struct uml_net_private)
                { .list                 = LIST_HEAD_INIT(lp->list),
-                 .lock                 = SPIN_LOCK_UNLOCKED,
                  .dev                  = dev,
                  .fd                   = -1,
                  .mac                  = { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0},
@@ -400,6 +399,7 @@ static int eth_configure(int n, void *init, char *mac,
                  .user                 = { save } });
 
        init_timer(&lp->tl);
+       spin_lock_init(&lp->lock);
        lp->tl.function = uml_net_user_timer_expire;
        if (lp->have_mac)
                memcpy(lp->mac, device->mac, sizeof(lp->mac));
@@ -728,7 +728,8 @@ static void close_devices(void)
 
        list_for_each(ele, &opened){
                lp = list_entry(ele, struct uml_net_private, list);
-               if(lp->close != NULL) (*lp->close)(lp->fd, &lp->user);
+               if((lp->close != NULL) && (lp->fd >= 0))
+                       (*lp->close)(lp->fd, &lp->user);
                if(lp->remove != NULL) (*lp->remove)(&lp->user);
        }
 }