Skip to content

Commit

Permalink
debugfs: Fix module state check condition
Browse files Browse the repository at this point in the history
The '#ifdef MODULE' check in the original commit does not work as intended.
The code under the check is not built at all if CONFIG_DEBUG_FS=y. Fix this
by using a correct check.

Fixes: 275678e ("debugfs: Check module state before warning in {full/open}_proxy_open()")
Signed-off-by: Vladis Dronov <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
nefigtut authored and gregkh committed Sep 4, 2020
1 parent 40b8b82 commit e3b9fc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/debugfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static int open_proxy_open(struct inode *inode, struct file *filp)
goto out;

if (!fops_get(real_fops)) {
#ifdef MODULE
#ifdef CONFIG_MODULES
if (real_fops->owner &&
real_fops->owner->state == MODULE_STATE_GOING)
goto out;
Expand Down Expand Up @@ -312,7 +312,7 @@ static int full_proxy_open(struct inode *inode, struct file *filp)
goto out;

if (!fops_get(real_fops)) {
#ifdef MODULE
#ifdef CONFIG_MODULES
if (real_fops->owner &&
real_fops->owner->state == MODULE_STATE_GOING)
goto out;
Expand Down

0 comments on commit e3b9fc7

Please sign in to comment.