Commit efe8b031 authored by Colin Ian King's avatar Colin Ian King Committed by Mauro Carvalho Chehab

media: stv090x: fix double free on state object

There two callers of stv090x_setup_compound manage the allocation and
freeing if state there is an error condition from stv090x_setup_compound.
Currently function stv090x_setup_compound also frees the state object
too, leading to a double free in the callers of this function.  Fix
this by removing the extraneous free in stv090x_setup_compound and just
leave the callers handle the allocation/free'ing.
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 575f6031
...@@ -4942,7 +4942,6 @@ static int stv090x_setup_compound(struct stv090x_state *state) ...@@ -4942,7 +4942,6 @@ static int stv090x_setup_compound(struct stv090x_state *state)
return 0; return 0;
error: error:
kfree(state);
return -ENOMEM; return -ENOMEM;
err_remove: err_remove:
remove_dev(state->internal); remove_dev(state->internal);
......
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