Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41657
b: refs/heads/master
c: b41848b
h: refs/heads/master
i:
  41655: be260e7
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Dec 3, 2006
1 parent 115daca commit 88d1fa8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 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: b6cd27ed33886a5ffaf0925a6d98e13e18e8a1af
refs/heads/master: b41848b61bae30e3661efd4ec62ea380cedef687
7 changes: 5 additions & 2 deletions trunk/drivers/net/netconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ __setup("netconsole=", option_setup);

static int init_netconsole(void)
{
int err;

if(strlen(config))
option_setup(config);

Expand All @@ -110,8 +112,9 @@ static int init_netconsole(void)
return 0;
}

if(netpoll_setup(&np))
return -EINVAL;
err = netpoll_setup(&np);
if (err)
return err;

register_console(&netconsole);
printk(KERN_INFO "netconsole: network logging started\n");
Expand Down
20 changes: 13 additions & 7 deletions trunk/net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,20 +611,23 @@ int netpoll_setup(struct netpoll *np)
struct in_device *in_dev;
struct netpoll_info *npinfo;
unsigned long flags;
int err;

if (np->dev_name)
ndev = dev_get_by_name(np->dev_name);
if (!ndev) {
printk(KERN_ERR "%s: %s doesn't exist, aborting.\n",
np->name, np->dev_name);
return -1;
return -ENODEV;
}

np->dev = ndev;
if (!ndev->npinfo) {
npinfo = kmalloc(sizeof(*npinfo), GFP_KERNEL);
if (!npinfo)
if (!npinfo) {
err = -ENOMEM;
goto release;
}

npinfo->rx_flags = 0;
npinfo->rx_np = NULL;
Expand All @@ -645,6 +648,7 @@ int netpoll_setup(struct netpoll *np)
if (!ndev->poll_controller) {
printk(KERN_ERR "%s: %s doesn't support polling, aborting.\n",
np->name, np->dev_name);
err = -ENOTSUPP;
goto release;
}

Expand All @@ -655,13 +659,14 @@ int netpoll_setup(struct netpoll *np)
np->name, np->dev_name);

rtnl_lock();
if (dev_change_flags(ndev, ndev->flags | IFF_UP) < 0) {
err = dev_open(ndev);
rtnl_unlock();

if (err) {
printk(KERN_ERR "%s: failed to open %s\n",
np->name, np->dev_name);
rtnl_unlock();
np->name, ndev->name);
goto release;
}
rtnl_unlock();

atleast = jiffies + HZ/10;
atmost = jiffies + 4*HZ;
Expand Down Expand Up @@ -699,6 +704,7 @@ int netpoll_setup(struct netpoll *np)
rcu_read_unlock();
printk(KERN_ERR "%s: no IP address for %s, aborting\n",
np->name, np->dev_name);
err = -EDESTADDRREQ;
goto release;
}

Expand Down Expand Up @@ -731,7 +737,7 @@ int netpoll_setup(struct netpoll *np)
kfree(npinfo);
np->dev = NULL;
dev_put(ndev);
return -1;
return err;
}

static int __init netpoll_init(void) {
Expand Down

0 comments on commit 88d1fa8

Please sign in to comment.