From: Corey Minyard Date: Wed, 17 May 2023 08:54:12 +0000 (+0800) Subject: ipmi_watchdog: Fix read syscall not responding to signals during sleep X-Git-Tag: v6.6-rc1~127^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9930702cfebb24acf6c000b55541239095447e47;p=thirdparty%2Flinux.git 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 Message-Id: <20230517085412.367022-1-zhen.ni@easystack.cn> Signed-off-by: Corey Minyard --- diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 0d4a8dcacfd4b..9a459257489f0 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();