mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
vgaarb: fix signal handling in vga_get()
commit 9f5bd30818c42c6c36a51f93b4df75a2ea2bd85e upstream. 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: Kirill A. Shutemov <kirill@shutemov.name> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Zefan Li <lizefan@huawei.com>
This commit is contained in:
parent
10c6ff6e59
commit
1405c2b764
1 changed files with 4 additions and 2 deletions
|
@ -381,8 +381,10 @@ int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible)
|
|||
set_current_state(interruptible ?
|
||||
TASK_INTERRUPTIBLE :
|
||||
TASK_UNINTERRUPTIBLE);
|
||||
if (signal_pending(current)) {
|
||||
rc = -EINTR;
|
||||
if (interruptible && signal_pending(current)) {
|
||||
__set_current_state(TASK_RUNNING);
|
||||
remove_wait_queue(&vga_wait_queue, &wait);
|
||||
rc = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
schedule();
|
||||
|
|
Loading…
Reference in a new issue