diff options
author | Julia Lawall <julia@diku.dk> | 2011-11-15 17:53:11 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-11-22 15:21:10 -0500 |
commit | c916874d60d9daf2e2d5f4f622b185ef57deb6a4 (patch) | |
tree | e5e939d2d5565ea59089b3b5ba2c6a325c1bd502 /drivers/gpu/vga | |
parent | 21240f9bc1b0ac925cd18b74618327a110022332 (diff) |
drivers/gpu/vga/vgaarb.c: add missing kfree
kbuf is a buffer that is local to this function, so all of the error paths
leaving the function should release it.
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/vga')
-rw-r--r-- | drivers/gpu/vga/vgaarb.c | 18 |
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 | ||