All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Ajay.Kathat@microchip.com>
To: <linux-wireless@vger.kernel.org>
Cc: <Claudiu.Beznea@microchip.com>, <Sripad.Balwadgi@microchip.com>,
	<Ajay.Kathat@microchip.com>
Subject: [PATCH 3/5] wilc1000: fix crash observed in AP mode with cfg80211_register_netdevice()
Date: Wed, 4 May 2022 16:19:26 +0000	[thread overview]
Message-ID: <20220504161924.2146601-3-ajay.kathat@microchip.com> (raw)
In-Reply-To: <20220504161924.2146601-1-ajay.kathat@microchip.com>

From: Ajay Singh <ajay.kathat@microchip.com>

Monitor(mon.) interface is used for handling the AP mode and 'ieee80211_ptr'
reference is not getting set for it. Like earlier implementation,
use register_netdevice() instead of cfg80211_register_netdevice() which
expects valid 'ieee80211_ptr' reference to avoid the possible crash.

Fixes: 2fe8ef106238 ("cfg80211: change netdev registration/unregistration semantics")
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/net/wireless/microchip/wilc1000/mon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/microchip/wilc1000/mon.c b/drivers/net/wireless/microchip/wilc1000/mon.c
index 6bd63934c2d8..b5a1b65c087c 100644
--- a/drivers/net/wireless/microchip/wilc1000/mon.c
+++ b/drivers/net/wireless/microchip/wilc1000/mon.c
@@ -233,7 +233,7 @@ struct net_device *wilc_wfi_init_mon_interface(struct wilc *wl,
 	wl->monitor_dev->netdev_ops = &wilc_wfi_netdev_ops;
 	wl->monitor_dev->needs_free_netdev = true;
 
-	if (cfg80211_register_netdevice(wl->monitor_dev)) {
+	if (register_netdevice(wl->monitor_dev)) {
 		netdev_err(real_dev, "register_netdevice failed\n");
 		free_netdev(wl->monitor_dev);
 		return NULL;
@@ -251,7 +251,7 @@ void wilc_wfi_deinit_mon_interface(struct wilc *wl, bool rtnl_locked)
 		return;
 
 	if (rtnl_locked)
-		cfg80211_unregister_netdevice(wl->monitor_dev);
+		unregister_netdevice(wl->monitor_dev);
 	else
 		unregister_netdev(wl->monitor_dev);
 	wl->monitor_dev = NULL;
-- 
2.25.1

  parent reply	other threads:[~2022-05-04 16:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 16:19 [PATCH 1/5] wilc1000: increase firmware version array size Ajay.Kathat
2022-05-04 16:19 ` [PATCH 2/5] wilc1000: use fixed function base register value to access SDIO_FBR_ENABLE_CSA Ajay.Kathat
2022-05-04 16:19 ` [PATCH 4/5] wilc1000: use 'u64' datatype for cookie variable Ajay.Kathat
2022-05-04 16:19 ` Ajay.Kathat [this message]
2022-05-09 11:50   ` [PATCH 3/5] wilc1000: fix crash observed in AP mode with cfg80211_register_netdevice() Kalle Valo
2022-05-09 13:49     ` Ajay.Kathat
2022-05-09 19:44       ` Johannes Berg
2022-05-10  9:55         ` Ajay.Kathat
2022-05-11  4:41           ` Kalle Valo
2022-05-04 16:19 ` [PATCH 5/5] wilc1000: add valid vmm_entry check before fetching from TX queue Ajay.Kathat
2022-05-11  5:25 ` [PATCH 1/5] wilc1000: increase firmware version array size Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220504161924.2146601-3-ajay.kathat@microchip.com \
    --to=ajay.kathat@microchip.com \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=Sripad.Balwadgi@microchip.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.