mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 04:34:08 +08:00
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: 275678e7a9
("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>
This commit is contained in:
parent
40b8b826a6
commit
e3b9fc7eec
@ -177,7 +177,7 @@ static int open_proxy_open(struct inode *inode, struct file *filp)
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!fops_get(real_fops)) {
|
if (!fops_get(real_fops)) {
|
||||||
#ifdef MODULE
|
#ifdef CONFIG_MODULES
|
||||||
if (real_fops->owner &&
|
if (real_fops->owner &&
|
||||||
real_fops->owner->state == MODULE_STATE_GOING)
|
real_fops->owner->state == MODULE_STATE_GOING)
|
||||||
goto out;
|
goto out;
|
||||||
@ -312,7 +312,7 @@ static int full_proxy_open(struct inode *inode, struct file *filp)
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!fops_get(real_fops)) {
|
if (!fops_get(real_fops)) {
|
||||||
#ifdef MODULE
|
#ifdef CONFIG_MODULES
|
||||||
if (real_fops->owner &&
|
if (real_fops->owner &&
|
||||||
real_fops->owner->state == MODULE_STATE_GOING)
|
real_fops->owner->state == MODULE_STATE_GOING)
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
Reference in New Issue
Block a user