Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1349974

[PATCH 3.12 069/116] vgaarb: fix signal handling in vga_get()

From Jiri Slaby <jslaby@suse.cz>
Newsgroups linux.kernel
Subject [PATCH 3.12 069/116] vgaarb: fix signal handling in vga_get()
Date 2016-03-04 10:10 +0100
Message-ID <r8TUg-4rg-37@gated-at.bofh.it> (permalink)
References <r8TUd-4rg-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: "Kirill A. Shutemov" <kirill@shutemov.name>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

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: Jiri Slaby <jslaby@suse.cz>
---
 drivers/gpu/vga/vgaarb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index af0259708358..bbb554d586d4 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -392,8 +392,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();
-- 
2.7.2

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 3.12 069/116] vgaarb: fix signal handling in vga_get() Jiri Slaby <jslaby@suse.cz> - 2016-03-04 10:10 +0100

csiph-web