[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230517092508.369197-1-zhen.ni@easystack.cn>
Date: Wed, 17 May 2023 17:25:08 +0800
From: Zhen Ni <zhen.ni@...ystack.cn>
To: minyard@....org
Cc: linux-kernel@...r.kernel.org, Zhen Ni <zhen.ni@...ystack.cn>
Subject: [PATCH] ipmi_watchdog: Fix read syscall not responding to signals during sleep
Read syscall cannot response to sigals when data_to_read remains at 0
and the while loop cannot break. Fix it.
Signed-off-by: Zhen Ni <zhen.ni@...ystack.cn>
---
drivers/char/ipmi/ipmi_watchdog.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index 0d4a8dcacfd4..e7eb3e140444 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -807,13 +807,12 @@ static ssize_t ipmi_read(struct file *file,
spin_unlock_irq(&ipmi_read_lock);
schedule();
spin_lock_irq(&ipmi_read_lock);
+ if (signal_pending(current)) {
+ rv = -ERESTARTSYS;
+ break;
+ }
}
remove_wait_queue(&read_q, &wait);
-
- if (signal_pending(current)) {
- rv = -ERESTARTSYS;
- goto out;
- }
}
data_to_read = 0;
--
2.20.1
Powered by blists - more mailing lists