Commit 01a356fd authored by Dan Carpenter's avatar Dan Carpenter Committed by Dave Airlie

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: default avatarDan Carpenter <error27@gmail.com>
Reviewed-by: default avatarMatt Turner <mattst88@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent ba1163de
...@@ -1136,6 +1136,7 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32 ...@@ -1136,6 +1136,7 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32
int len, ws, ps, ptr; int len, ws, ps, ptr;
unsigned char op; unsigned char op;
atom_exec_context ectx; atom_exec_context ectx;
int ret = 0;
if (!base) if (!base)
return -EINVAL; return -EINVAL;
...@@ -1168,7 +1169,8 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32 ...@@ -1168,7 +1169,8 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32
if (ectx.abort) { if (ectx.abort) {
DRM_ERROR("atombios stuck executing %04X (len %d, WS %d, PS %d) @ 0x%04X\n", DRM_ERROR("atombios stuck executing %04X (len %d, WS %d, PS %d) @ 0x%04X\n",
base, len, ws, ps, ptr - 1); base, len, ws, ps, ptr - 1);
return -EINVAL; ret = -EINVAL;
goto free;
} }
if (op < ATOM_OP_CNT && op > 0) 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,9 +1185,10 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32
debug_depth--; debug_depth--;
SDEBUG("<<\n"); SDEBUG("<<\n");
free:
if (ws) if (ws)
kfree(ectx.ws); kfree(ectx.ws);
return 0; return ret;
} }
int atom_execute_table(struct atom_context *ctx, int index, uint32_t * params) int atom_execute_table(struct atom_context *ctx, int index, uint32_t * params)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment