aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2019-01-18 07:29:52 +0000
committerJohannes Berg <johannes.berg@intel.com>2019-01-19 09:12:16 +0100
commitf9d672f1c2ca36b788511bbd773d650c744e109a (patch)
treee56423a432760f4d71aadf3a194b0b522883cf8a
parenta0dc02039a2ee54fb4ae400e0b755ed30e73e58c (diff)
downloadlinux-stericsson-f9d672f1c2ca36b788511bbd773d650c744e109a.tar.gz
virt_wifi: fix error return code in virt_wifi_newlink()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: c7cdba31ed8b ("mac80211-next: rtnetlink wifi simulation device") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/virt_wifi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/virt_wifi.c b/drivers/net/wireless/virt_wifi.c
index 64b218699656..3a93e4d9828b 100644
--- a/drivers/net/wireless/virt_wifi.c
+++ b/drivers/net/wireless/virt_wifi.c
@@ -530,8 +530,10 @@ static int virt_wifi_newlink(struct net *src_net, struct net_device *dev,
SET_NETDEV_DEV(dev, &priv->lowerdev->dev);
dev->ieee80211_ptr = kzalloc(sizeof(*dev->ieee80211_ptr), GFP_KERNEL);
- if (!dev->ieee80211_ptr)
+ if (!dev->ieee80211_ptr) {
+ err = -ENOMEM;
goto remove_handler;
+ }
dev->ieee80211_ptr->iftype = NL80211_IFTYPE_STATION;
dev->ieee80211_ptr->wiphy = common_wiphy;