From: Colin Ian King Date: Tue, 11 Jun 2019 15:38:12 +0000 (-0400) Subject: media: stv090x: fix double free on state object X-Git-Tag: Ubuntu-5.10.0-12.13~5032^2~144 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=efe8b031d8eb92ef8c68efd05ca5c11a1050619a;p=mirror_ubuntu-hirsute-kernel.git 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: Colin Ian King Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb-frontends/stv090x.c b/drivers/media/dvb-frontends/stv090x.c index 986e585e0103..90d24131d335 100644 --- a/drivers/media/dvb-frontends/stv090x.c +++ b/drivers/media/dvb-frontends/stv090x.c @@ -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);