Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54297
b: refs/heads/master
c: 8c84083
h: refs/heads/master
i:
  54295: 2de5348
v: v3
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed May 7, 2007
1 parent bc6d027 commit 1a93670
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 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: e024715f5f6250179a31716a898800a48cf23b39
refs/heads/master: 8c8408358f19a386298744829bf67b90c129ff18
25 changes: 13 additions & 12 deletions trunk/arch/um/drivers/net_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,39 +348,41 @@ static void eth_configure(int n, void *init, char *mac,
struct net_device *dev;
struct uml_net_private *lp;
int save, err, size;
char name[sizeof(dev->name)];

size = transport->private_size + sizeof(struct uml_net_private) +
sizeof(((struct uml_net_private *) 0)->user);

device = kzalloc(sizeof(*device), GFP_KERNEL);
if (device == NULL) {
printk(KERN_ERR "eth_configure failed to allocate uml_net\n");
printk(KERN_ERR "eth_configure failed to allocate struct "
"uml_net\n");
return;
}

dev = alloc_etherdev(size);
if (dev == NULL) {
printk(KERN_ERR "eth_configure: failed to allocate struct "
"net_device for eth%d\n", n);
goto out_free_device;
}

INIT_LIST_HEAD(&device->list);
device->index = n;

/* If this name ends up conflicting with an existing registered
* netdevice, that is OK, register_netdev{,ice}() will notice this
* and fail.
*/
snprintf(name, sizeof(name), "eth%d", n);
snprintf(dev->name, sizeof(dev->name), "eth%d", n);

setup_etheraddr(mac, device->mac, name);
setup_etheraddr(mac, device->mac, dev->name);

printk(KERN_INFO "Netdevice %d ", n);
printk("(%02x:%02x:%02x:%02x:%02x:%02x) ",
device->mac[0], device->mac[1],
device->mac[2], device->mac[3],
device->mac[4], device->mac[5]);
printk(": ");
dev = alloc_etherdev(size);
if (dev == NULL) {
printk(KERN_ERR "eth_configure: failed to allocate device\n");
goto out_free_device;
}

lp = dev->priv;
/* This points to the transport private data. It's still clear, but we
Expand All @@ -399,7 +401,6 @@ static void eth_configure(int n, void *init, char *mac,
goto out_free_netdev;
SET_NETDEV_DEV(dev,&device->pdev.dev);

strcpy(dev->name, name);
device->dev = dev;

/*
Expand Down Expand Up @@ -466,13 +467,13 @@ static void eth_configure(int n, void *init, char *mac,
return;

out_undo_user_init:
if (transport->user->init != NULL)
if (transport->user->remove != NULL)
(*transport->user->remove)(&lp->user);
out_unregister:
platform_device_unregister(&device->pdev);
out_free_netdev:
free_netdev(dev);
out_free_device: ;
out_free_device:
kfree(device);
}

Expand Down

0 comments on commit 1a93670

Please sign in to comment.