]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/netconsole.c
virtio: explicit advertisement of driver features
[linux-2.6-omap-h63xx.git] / drivers / net / netconsole.c
index 31e047dd7bb349d7e38d394c02e6a041f6ee29df..665341e43055a3079465354f91c31b315d70e034 100644 (file)
@@ -309,8 +309,8 @@ static ssize_t show_local_mac(struct netconsole_target *nt, char *buf)
        struct net_device *dev = nt->np.dev;
 
        DECLARE_MAC_BUF(mac);
-       return snprintf(buf, PAGE_SIZE, "%s\n",
-                       print_mac(mac, dev->dev_addr));
+       return snprintf(buf, PAGE_SIZE, "%s\n", dev ?
+                       print_mac(mac, dev->dev_addr) : "ff:ff:ff:ff:ff:ff");
 }
 
 static ssize_t show_remote_mac(struct netconsole_target *nt, char *buf)
@@ -730,7 +730,7 @@ static void write_msg(struct console *con, const char *msg, unsigned int len)
 
 static struct console netconsole = {
        .name   = "netcon",
-       .flags  = CON_ENABLED | CON_PRINTBUFFER,
+       .flags  = CON_ENABLED,
        .write  = write_msg,
 };
 
@@ -749,6 +749,9 @@ static int __init init_netconsole(void)
                                err = PTR_ERR(nt);
                                goto fail;
                        }
+                       /* Dump existing printks when we register */
+                       netconsole.flags |= CON_PRINTBUFFER;
+
                        spin_lock_irqsave(&target_list_lock, flags);
                        list_add(&nt->list, &target_list);
                        spin_unlock_irqrestore(&target_list_lock, flags);