From: Amitkumar Karwar <akarwar@xxxxxxxxxxx> In failure case dev_alloc_name() returns negative errno code. This patch corrects the check used for handling error path. Signed-off-by: Amitkumar Karwar <akarwar@xxxxxxxxxxx> Signed-off-by: Yogesh Ashok Powar <yogeshp@xxxxxxxxxxx> Signed-off-by: Bing Zhao <bzhao@xxxxxxxxxxx> --- drivers/net/wireless/mwifiex/main.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index f6db51c..77c104b 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c @@ -684,6 +684,7 @@ static struct mwifiex_private *mwifiex_add_interface( struct net_device *dev; struct mwifiex_private *priv; void *mdev_priv; + int ret; dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), "mlan%d", ether_setup, 1); @@ -691,8 +692,11 @@ static struct mwifiex_private *mwifiex_add_interface( dev_err(adapter->dev, "no memory available for netdevice\n"); goto error; } - if (dev_alloc_name(dev, dev->name)) { - dev_err(adapter->dev, "unable to alloc name for netdevice\n"); + + ret = dev_alloc_name(dev, dev->name); + if (ret < 0) { + dev_err(adapter->dev, "unable to alloc dev name '%s': %d\n", + dev->name, ret); goto error; } -- 1.7.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html