Skip to content

Commit 9930702

Browse files
committed
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 <[email protected]> Message-Id: <[email protected]> Signed-off-by: Corey Minyard <[email protected]>
1 parent 4d6d4c7 commit 9930702

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/char/ipmi/ipmi_watchdog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ static ssize_t ipmi_read(struct file *file,
802802

803803
init_waitqueue_entry(&wait, current);
804804
add_wait_queue(&read_q, &wait);
805-
while (!data_to_read) {
805+
while (!data_to_read && !signal_pending(current)) {
806806
set_current_state(TASK_INTERRUPTIBLE);
807807
spin_unlock_irq(&ipmi_read_lock);
808808
schedule();

0 commit comments

Comments
 (0)