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

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
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -4942,7 +4942,6 @@ static int stv090x_setup_compound(struct stv090x_state *state)
	return 0;

error:
	kfree(state);
	return -ENOMEM;
err_remove:
	remove_dev(state->internal);