diff options
author | Corey Minyard <minyard@acm.org> | 2023-05-17 10:54:12 +0200 |
---|---|---|
committer | Corey Minyard <minyard@acm.org> | 2023-05-19 00:31:31 +0200 |
commit | 9930702cfebb24acf6c000b55541239095447e47 (patch) | |
tree | 96b9420715402ee8454349c1ba63f32087d256fb /drivers/char | |
parent | Merge tag 'linux-kselftest-fixes-6.4-rc3' of git://git.kernel.org/pub/scm/lin... (diff) | |
download | linux-9930702cfebb24acf6c000b55541239095447e47.tar.xz linux-9930702cfebb24acf6c000b55541239095447e47.zip |
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. Check signal_pending in the loop.
Reported-by: Zhen Ni <zhen.ni@easystack.cn>
Message-Id: <20230517085412.367022-1-zhen.ni@easystack.cn>
Signed-off-by: Corey Minyard <minyard@acm.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/ipmi_watchdog.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 0d4a8dcacfd4..9a459257489f 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c @@ -802,7 +802,7 @@ static ssize_t ipmi_read(struct file *file, init_waitqueue_entry(&wait, current); add_wait_queue(&read_q, &wait); - while (!data_to_read) { + while (!data_to_read && !signal_pending(current)) { set_current_state(TASK_INTERRUPTIBLE); spin_unlock_irq(&ipmi_read_lock); schedule(); |