Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19978
b: refs/heads/master
c: 14d9ead
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Feb 8, 2006
1 parent 8fd3d11 commit 11fae12
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d2ddcfb1935c9c0e98c4295458b01f24e3274f9
refs/heads/master: 14d9ead05ec925f299ae5cfe948c180c88ec842e
29 changes: 19 additions & 10 deletions trunk/arch/um/drivers/net_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ static int uml_net_open(struct net_device *dev)
SA_INTERRUPT | SA_SHIRQ, dev->name, dev);
if(err != 0){
printk(KERN_ERR "uml_net_open: failed to get irq(%d)\n", err);
if(lp->close != NULL) (*lp->close)(lp->fd, &lp->user);
lp->fd = -1;
err = -ENETUNREACH;
goto out_close;
}

lp->tl.data = (unsigned long) &lp->user;
Expand All @@ -145,9 +144,19 @@ static int uml_net_open(struct net_device *dev)
*/
while((err = uml_net_rx(dev)) > 0) ;

out:
spin_unlock(&lp->lock);
return(err);

spin_lock(&opened_lock);
list_add(&lp->list, &opened);
spin_unlock(&opened_lock);

return 0;
out_close:
if(lp->close != NULL) (*lp->close)(lp->fd, &lp->user);
lp->fd = -1;
out:
spin_unlock(&lp->lock);
return err;
}

static int uml_net_close(struct net_device *dev)
Expand All @@ -161,9 +170,13 @@ static int uml_net_close(struct net_device *dev)
if(lp->close != NULL)
(*lp->close)(lp->fd, &lp->user);
lp->fd = -1;
list_del(&lp->list);

spin_unlock(&lp->lock);

spin_lock(&opened_lock);
list_del(&lp->list);
spin_unlock(&opened_lock);

return 0;
}

Expand Down Expand Up @@ -410,11 +423,7 @@ static int eth_configure(int n, void *init, char *mac,
if (device->have_mac)
set_ether_mac(dev, device->mac);

spin_lock(&opened_lock);
list_add(&lp->list, &opened);
spin_unlock(&opened_lock);

return(0);
return 0;
}

static struct uml_net *find_device(int n)
Expand Down

0 comments on commit 11fae12

Please sign in to comment.