linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] virt_wifi: fix error return code in virt_wifi_newlink()
@ 2019-01-18  7:29 Wei Yongjun
  2019-01-18  9:30 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2019-01-18  7:29 UTC (permalink / raw)
  To: Kalle Valo, Cody Schuffelen; +Cc: Wei Yongjun, linux-wireless, kernel-janitors

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>
---
 drivers/net/wireless/virt_wifi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/virt_wifi.c b/drivers/net/wireless/virt_wifi.c
index 64b2186..3a93e4d 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;




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] virt_wifi: fix error return code in virt_wifi_newlink()
  2019-01-18  7:29 [PATCH net-next] virt_wifi: fix error return code in virt_wifi_newlink() Wei Yongjun
@ 2019-01-18  9:30 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2019-01-18  9:30 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Cody Schuffelen, linux-wireless, kernel-janitors

Wei Yongjun <weiyongjun1@huawei.com> writes:

> 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>

BTW, virt_wifi patches go through mac80211-next, not via net-next.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-18  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-18  7:29 [PATCH net-next] virt_wifi: fix error return code in virt_wifi_newlink() Wei Yongjun
2019-01-18  9:30 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).