Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=69c368... Commit: 69c3683ca7fe066ecba9e8a0424c5abd258a5d58 Parent: b5c15fc004ac83b7ad280acbe0fd4bbed7e2c8d4 Author: Keiichi KII <k-keiichi@bx.jp.nec.com> AuthorDate: Fri Feb 15 02:01:58 2008 -0800 Committer: David S. Miller <davem@davemloft.net> CommitDate: Fri Feb 15 02:01:58 2008 -0800 netconsole: avoid null pointer dereference at show_local_mac() This patch avoids a null pointer dereference when we read local_mac for netconsole in configfs and shows default local mac address value. A null pointer dereference occurs when we call show_local_mac() via local_mac entry in configfs before we setup the content of netpoll using netpoll_setup(). Signed-off-by: Keiichi KII <k-keiichi@bx.jp.nec.com> Signed-off-by: David S. Miller <davem@davemloft.net> --- drivers/net/netconsole.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 31e047d..501e451 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -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) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Linus Torvalds | Linux 2.6.27-rc5 |
| Jared Hulbert | [PATCH 00/10] AXFS: Advanced XIP filesystem |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Linus Torvalds | Linux 2.6.27-rc8 |
git: | |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Mark McLoughlin | [PATCH] bridge: make bridge-nf-call-*tables default configurable |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
