media: stv090x: fix double free on state object
authorColin Ian King <colin.king@canonical.com>
Tue, 11 Jun 2019 15:38:12 +0000 (11:38 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 21 Jun 2019 19:33:07 +0000 (15:33 -0400)
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 <colin.king@canonical.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/dvb-frontends/stv090x.c

index 986e585e01032d5052393ced87a5dbfb47afef3f..90d24131d335f78aa5da365b05aebdeb0a11d67e 100644 (file)
@@ -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);