netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] wimax: i2400m - prevent a possible kernel bug due to missing fw_name string
@ 2012-03-26 11:23 Phil Sutter
  2012-03-26 11:23 ` [PATCH 2/2] wimax: i2400m-usb - use a private struct ethtool_ops Phil Sutter
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Phil Sutter @ 2012-03-26 11:23 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, inaky.perez-gonzalez

This happened on a machine with a custom hotplug script calling nameif,
probably due to slow firmware loading. At the time nameif uses ethtool
to gather interface information, i2400m->fw_name is zero and so a null
pointer dereference occurs from within i2400m_get_drvinfo().

Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
---
 drivers/net/wimax/i2400m/netdev.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c
index 64a1106..020bd8d 100644
--- a/drivers/net/wimax/i2400m/netdev.c
+++ b/drivers/net/wimax/i2400m/netdev.c
@@ -607,7 +607,8 @@ static void i2400m_get_drvinfo(struct net_device *net_dev,
 	struct i2400m *i2400m = net_dev_to_i2400m(net_dev);
 
 	strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1);
-	strncpy(info->fw_version, i2400m->fw_name, sizeof(info->fw_version) - 1);
+	strncpy(info->fw_version,
+	        i2400m->fw_name ? : "N/A", sizeof(info->fw_version) - 1);
 	if (net_dev->dev.parent)
 		strncpy(info->bus_info, dev_name(net_dev->dev.parent),
 			sizeof(info->bus_info) - 1);
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-03-28  2:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-26 11:23 [PATCH 1/2] wimax: i2400m - prevent a possible kernel bug due to missing fw_name string Phil Sutter
2012-03-26 11:23 ` [PATCH 2/2] wimax: i2400m-usb - use a private struct ethtool_ops Phil Sutter
2012-03-28  2:30   ` David Miller
2012-03-26 14:57 ` [PATCH 1/2] wimax: i2400m - prevent a possible kernel bug due to missing fw_name string Ben Hutchings
2012-03-26 19:01   ` [PATCHv2 " Phil Sutter
2012-03-26 19:01     ` [PATCHv2 2/2] wimax: i2400m-usb - use a private struct ethtool_ops Phil Sutter
2012-03-28  2:30 ` [PATCH 1/2] wimax: i2400m - prevent a possible kernel bug due to missing fw_name string David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).