diff options
author | Phil Sutter <phil.sutter@viprinet.com> | 2012-03-26 05:01:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-27 22:30:09 -0400 |
commit | 4eee6a3a04e8bb53fbe7de0f64d0524d3fbe3f80 (patch) | |
tree | f53517770ad3cda21d4689106e2ec3570c31f2be /drivers/net/wimax | |
parent | 7dd30d447b7f4a129586cce8e57d0163dde876b0 (diff) |
wimax: i2400m - prevent a possible kernel bug due to missing fw_name string
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wimax')
-rw-r--r-- | 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 63e4b709efa9..1d76ae855f07 100644 --- a/drivers/net/wimax/i2400m/netdev.c +++ b/drivers/net/wimax/i2400m/netdev.c | |||
@@ -597,7 +597,8 @@ static void i2400m_get_drvinfo(struct net_device *net_dev, | |||
597 | struct i2400m *i2400m = net_dev_to_i2400m(net_dev); | 597 | struct i2400m *i2400m = net_dev_to_i2400m(net_dev); |
598 | 598 | ||
599 | strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1); | 599 | strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1); |
600 | strncpy(info->fw_version, i2400m->fw_name, sizeof(info->fw_version) - 1); | 600 | strncpy(info->fw_version, |
601 | i2400m->fw_name ? : "", sizeof(info->fw_version) - 1); | ||
601 | if (net_dev->dev.parent) | 602 | if (net_dev->dev.parent) |
602 | strncpy(info->bus_info, dev_name(net_dev->dev.parent), | 603 | strncpy(info->bus_info, dev_name(net_dev->dev.parent), |
603 | sizeof(info->bus_info) - 1); | 604 | sizeof(info->bus_info) - 1); |