]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kbuf is a buffer that is local to this function, so all of the error paths
authorJulia Lawall <julia@diku.dk>
Wed, 24 Aug 2011 23:46:21 +0000 (09:46 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 23 Sep 2011 05:15:04 +0000 (15:15 +1000)
leaving the function should release it.

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
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);