summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-04-06 10:55:33 +0000
committerDave Airlie <airlied@redhat.com>2010-04-07 10:11:36 +1000
commit01a356fd2a5f5e72e783312037ace05df4ab4e32 (patch)
tree11d1d96e80335555a0bbc8d914104169531f5ff3 /drivers/gpu
parentba1163de2f74d624e7b0e530c4104c98ede0045a (diff)
downloadlinux-stable-01a356fd2a5f5e72e783312037ace05df4ab4e32.tar.gz
linux-stable-01a356fd2a5f5e72e783312037ace05df4ab4e32.tar.bz2
linux-stable-01a356fd2a5f5e72e783312037ace05df4ab4e32.zip
drm/radeon/kms: small memory leak in atom exit code
This is an unlikely memory leak, but we may as well fix it. It's easy to fix and every static checker will complain if we don't. Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/atom.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index 247f8ee7e940..58845e053b36 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -1136,6 +1136,7 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32
int len, ws, ps, ptr;
unsigned char op;
atom_exec_context ectx;
+ int ret = 0;
if (!base)
return -EINVAL;
@@ -1168,7 +1169,8 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32
if (ectx.abort) {
DRM_ERROR("atombios stuck executing %04X (len %d, WS %d, PS %d) @ 0x%04X\n",
base, len, ws, ps, ptr - 1);
- return -EINVAL;
+ ret = -EINVAL;
+ goto free;
}
if (op < ATOM_OP_CNT && op > 0)
@@ -1183,9 +1185,10 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32
debug_depth--;
SDEBUG("<<\n");
+free:
if (ws)
kfree(ectx.ws);
- return 0;
+ return ret;
}
int atom_execute_table(struct atom_context *ctx, int index, uint32_t * params)