提交 9f5bd308 编写于 作者: K Kirill A. Shutemov 提交者: Dave Airlie

vgaarb: fix signal handling in vga_get()

There are few defects in vga_get() related to signal hadning:

  - we shouldn't check for pending signals for TASK_UNINTERRUPTIBLE
    case;

  - if we found pending signal we must remove ourself from wait queue
    and change task state back to running;

  - -ERESTARTSYS is more appropriate, I guess.
Signed-off-by: NKirill A. Shutemov <kirill@shutemov.name>
Cc: stable@vger.kernel.org
Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 49307da3
...@@ -395,8 +395,10 @@ int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible) ...@@ -395,8 +395,10 @@ int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible)
set_current_state(interruptible ? set_current_state(interruptible ?
TASK_INTERRUPTIBLE : TASK_INTERRUPTIBLE :
TASK_UNINTERRUPTIBLE); TASK_UNINTERRUPTIBLE);
if (signal_pending(current)) { if (interruptible && signal_pending(current)) {
rc = -EINTR; __set_current_state(TASK_RUNNING);
remove_wait_queue(&vga_wait_queue, &wait);
rc = -ERESTARTSYS;
break; break;
} }
schedule(); schedule();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册