Subject: [patch] d80211: fix multiple device ap support

From: David Kimdon <[email-masked]>
Date: Tue, 5 Sep 2006 11:50:35 -0700

Another fix to the interpretation of dev_alloc_name() return value.
dev_alloc_name() returns the number of the unit assigned or a negative
errno code.

Signed-off-by: David Kimdon <[email-masked]>

Index: linux-2.6.16/net/d80211/ieee80211_iface.c
===================================================================
--- linux-2.6.16.orig/net/d80211/ieee80211_iface.c
+++ linux-2.6.16/net/d80211/ieee80211_iface.c
@@ -122,7 +122,7 @@ int ieee80211_if_add_mgmt(struct net_dev
 	if (!ndev)
 		return -ENOMEM;
 	ret = dev_alloc_name(ndev, "wmgmt%d");
-	if (ret)
+	if (ret < 0)
 		goto fail;
 
 	ndev->ieee80211_ptr = local;

--