Skip to content

Commit e3b9fc7

Browse files
nefigtutgregkh
authored andcommitted
debugfs: Fix module state check condition
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 <vdronov@redhat.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200811150129.53343-1-vdronov@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 40b8b82 commit e3b9fc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/debugfs/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static int open_proxy_open(struct inode *inode, struct file *filp)
177177
goto out;
178178

179179
if (!fops_get(real_fops)) {
180-
#ifdef MODULE
180+
#ifdef CONFIG_MODULES
181181
if (real_fops->owner &&
182182
real_fops->owner->state == MODULE_STATE_GOING)
183183
goto out;
@@ -312,7 +312,7 @@ static int full_proxy_open(struct inode *inode, struct file *filp)
312312
goto out;
313313

314314
if (!fops_get(real_fops)) {
315-
#ifdef MODULE
315+
#ifdef CONFIG_MODULES
316316
if (real_fops->owner &&
317317
real_fops->owner->state == MODULE_STATE_GOING)
318318
goto out;

0 commit comments

Comments
 (0)