diff options
author | Dan Carpenter <error27@gmail.com> | 2010-04-06 06:55:33 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-04-06 20:11:36 -0400 |
commit | 01a356fd2a5f5e72e783312037ace05df4ab4e32 (patch) | |
tree | 11d1d96e80335555a0bbc8d914104169531f5ff3 /drivers/gpu/drm/radeon/atom.c | |
parent | ba1163de2f74d624e7b0e530c4104c98ede0045a (diff) |
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/drm/radeon/atom.c')
-rw-r--r-- | drivers/gpu/drm/radeon/atom.c | 7 |
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 | |||
1136 | int len, ws, ps, ptr; | 1136 | int len, ws, ps, ptr; |
1137 | unsigned char op; | 1137 | unsigned char op; |
1138 | atom_exec_context ectx; | 1138 | atom_exec_context ectx; |
1139 | int ret = 0; | ||
1139 | 1140 | ||
1140 | if (!base) | 1141 | if (!base) |
1141 | return -EINVAL; | 1142 | return -EINVAL; |
@@ -1168,7 +1169,8 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32 | |||
1168 | if (ectx.abort) { | 1169 | if (ectx.abort) { |
1169 | DRM_ERROR("atombios stuck executing %04X (len %d, WS %d, PS %d) @ 0x%04X\n", | 1170 | DRM_ERROR("atombios stuck executing %04X (len %d, WS %d, PS %d) @ 0x%04X\n", |
1170 | base, len, ws, ps, ptr - 1); | 1171 | base, len, ws, ps, ptr - 1); |
1171 | return -EINVAL; | 1172 | ret = -EINVAL; |
1173 | goto free; | ||
1172 | } | 1174 | } |
1173 | 1175 | ||
1174 | if (op < ATOM_OP_CNT && op > 0) | 1176 | if (op < ATOM_OP_CNT && op > 0) |
@@ -1183,9 +1185,10 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32 | |||
1183 | debug_depth--; | 1185 | debug_depth--; |
1184 | SDEBUG("<<\n"); | 1186 | SDEBUG("<<\n"); |
1185 | 1187 | ||
1188 | free: | ||
1186 | if (ws) | 1189 | if (ws) |
1187 | kfree(ectx.ws); | 1190 | kfree(ectx.ws); |
1188 | return 0; | 1191 | return ret; |
1189 | } | 1192 | } |
1190 | 1193 | ||
1191 | int atom_execute_table(struct atom_context *ctx, int index, uint32_t * params) | 1194 | int atom_execute_table(struct atom_context *ctx, int index, uint32_t * params) |