]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/gpu/vga/vgaarb.c
kbuf is a buffer that is local to this function, so all of the error paths
[karo-tx-linux.git] / drivers / gpu / vga / vgaarb.c
index c72f1c0b5e637951a450b21378f2edfeb8e92725..18376f113b0fa7052cab69610ce556d630c49e47 100644 (file)
@@ -993,14 +993,20 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
                                uc = &priv->cards[i];
                }
 
-               if (!uc)
-                       return -EINVAL;
+               if (!uc) {
+                       ret_val = -EINVAL;
+                       goto done;
+               }
 
-               if (io_state & VGA_RSRC_LEGACY_IO && uc->io_cnt == 0)
-                       return -EINVAL;
+               if (io_state & VGA_RSRC_LEGACY_IO && uc->io_cnt == 0) {
+                       ret_val = -EINVAL;
+                       goto done;
+               }
 
-               if (io_state & VGA_RSRC_LEGACY_MEM && uc->mem_cnt == 0)
-                       return -EINVAL;
+               if (io_state & VGA_RSRC_LEGACY_MEM && uc->mem_cnt == 0) {
+                       ret_val = -EINVAL;
+                       goto done;
+               }
 
                vga_put(pdev, io_state);