Skip to content

Commit

Permalink
drm/radeon/kms: small memory leak in atom exit code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Dave Airlie committed Apr 7, 2010
1 parent ba1163d commit 01a356f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/gpu/drm/radeon/atom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 01a356f

Please sign in to comment.