Skip to content

Commit 4eee6a3

Browse files
Phil Sutterdavem330
authored andcommitted
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>
1 parent 7dd30d4 commit 4eee6a3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/net/wimax/i2400m/netdev.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,8 @@ static void i2400m_get_drvinfo(struct net_device *net_dev,
597597
struct i2400m *i2400m = net_dev_to_i2400m(net_dev);
598598

599599
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);
601602
if (net_dev->dev.parent)
602603
strncpy(info->bus_info, dev_name(net_dev->dev.parent),
603604
sizeof(info->bus_info) - 1);

0 commit comments

Comments
 (0)