aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/vga/vgaarb.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index bdde899af72e..111d956d8e7d 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -991,14 +991,20 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
991 uc = &priv->cards[i]; 991 uc = &priv->cards[i];
992 } 992 }
993 993
994 if (!uc) 994 if (!uc) {
995 return -EINVAL; 995 ret_val = -EINVAL;
996 goto done;
997 }
996 998
997 if (io_state & VGA_RSRC_LEGACY_IO && uc->io_cnt == 0) 999 if (io_state & VGA_RSRC_LEGACY_IO && uc->io_cnt == 0) {
998 return -EINVAL; 1000 ret_val = -EINVAL;
1001 goto done;
1002 }
999 1003
1000 if (io_state & VGA_RSRC_LEGACY_MEM && uc->mem_cnt == 0) 1004 if (io_state & VGA_RSRC_LEGACY_MEM && uc->mem_cnt == 0) {
1001 return -EINVAL; 1005 ret_val = -EINVAL;
1006 goto done;
1007 }
1002 1008
1003 vga_put(pdev, io_state); 1009 vga_put(pdev, io_state);
1004 1010