diff mbox series

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

Message ID 20201107172152.828-18-ap420073@gmail.com
State Changes Requested
Delegated to: David Miller
Headers show
Series net: avoid to remove module when its debugfs is being used | expand

Checks

Context Check Description
jkicinski/cover_letter success Link
jkicinski/fixes_present success Link
jkicinski/patch_count fail Series longer than 15 patches
jkicinski/tree_selection success Clearly marked for net
jkicinski/subject_prefix success Link
jkicinski/source_inline success Was 0 now: 0
jkicinski/verify_signedoff success Link
jkicinski/module_param success Was 0 now: 0
jkicinski/build_32bit success Errors and warnings before: 0 this patch: 0
jkicinski/kdoc success Errors and warnings before: 0 this patch: 0
jkicinski/verify_fixes success Link
jkicinski/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
jkicinski/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
jkicinski/header_inline success Link
jkicinski/stable success Stable not CCed

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)