diff mbox series

[net,v2,17/21] brcmfmac: set .owner to THIS_MODULE

Message ID 20201107172152.828-18-ap420073@gmail.com (mailing list archive)
State New, archived
Headers show
Series net: avoid to remove module when its debugfs is being used | expand

Commit Message

Taehee Yoo Nov. 7, 2020, 5:21 p.m. UTC
If THIS_MODULE is not set, the module would be removed while debugfs is
being used.
It eventually makes kernel panic.

Fixes: 2f8c8e62cd50 ("brcmfmac: add "reset" debugfs entry for testing reset")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---

v1 -> v2:
 - Change headline

 drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Arend van Spriel Nov. 7, 2020, 5:41 p.m. UTC | #1
On November 7, 2020 6:25:15 PM Taehee Yoo <ap420073@gmail.com> wrote:

> If THIS_MODULE is not set, the module would be removed while debugfs is
> being used.
> It eventually makes kernel panic.

Is this really a valid concern in the context of debugs? I tend to say it 
is not. Whenever I am using debugs to debug my driver I make sure to avoid 
removing it.

Regards,
Arend
Taehee Yoo Nov. 7, 2020, 6:16 p.m. UTC | #2
On Sun, 8 Nov 2020 at 02:41, Arend Van Spriel
<arend.vanspriel@broadcom.com> wrote:
>

Hi Arend,
Thank you for the review!

> On November 7, 2020 6:25:15 PM Taehee Yoo <ap420073@gmail.com> wrote:
>
> > If THIS_MODULE is not set, the module would be removed while debugfs is
> > being used.
> > It eventually makes kernel panic.
>
> Is this really a valid concern in the context of debugs? I tend to say it
> is not. Whenever I am using debugs to debug my driver I make sure to avoid
> removing it.

I think getting rid of every scenario of the kernel panic is the
first priority thing.
So I'm sure that trying to avoid kernel panic is always valid even
in the debugging context.

Thanks a lot!
Taehee Yoo
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index 3dd28f5fef19..a80b28189c99 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -1188,6 +1188,7 @@  static const struct file_operations bus_reset_fops = {
 	.open	= simple_open,
 	.llseek	= no_llseek,
 	.write	= bus_reset_write,
+	.owner = THIS_MODULE,
 };
 
 static int brcmf_bus_started(struct brcmf_pub *drvr, struct cfg80211_ops *ops)