diff options
author | Phil Sutter <phil.sutter@viprinet.com> | 2012-03-26 09:01:30 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-27 09:51:19 -0700 |
commit | 589336f3c7731b608e860e984f753909b00efad7 (patch) | |
tree | d6f9d44efe9adf07176a836b967c2201d99d6dbc | |
parent | 53288841cc5e7cb81b5980a46462d8a357bc3387 (diff) | |
download | kernel_samsung_espresso10-589336f3c7731b608e860e984f753909b00efad7.zip kernel_samsung_espresso10-589336f3c7731b608e860e984f753909b00efad7.tar.gz kernel_samsung_espresso10-589336f3c7731b608e860e984f753909b00efad7.tar.bz2 |
wimax: i2400m - prevent a possible kernel bug due to missing fw_name string
[ Upstream commit 4eee6a3a04e8bb53fbe7de0f64d0524d3fbe3f80 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 2edd8fe..0a99863 100644 --- a/drivers/net/wimax/i2400m/netdev.c +++ b/drivers/net/wimax/i2400m/netdev.c @@ -606,7 +606,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 ? : "", 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); |