summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-12-09 03:16:10 -0500
committerMichael Krufky <mkrufky@linuxtv.org>2007-12-09 03:16:10 -0500
commitc4c69027d6d6e2b4949d1c9b4101bc738e231088 (patch)
tree2fa34a3db5fbd1e4891647f989175c10c298c614
parent017775baf90cbd3c43a14e4d10e00e1aca9f98f2 (diff)
downloadmediapointer-dvb-s2-c4c69027d6d6e2b4949d1c9b4101bc738e231088.tar.gz
mediapointer-dvb-s2-c4c69027d6d6e2b4949d1c9b4101bc738e231088.tar.bz2
tda8290: prevent possible memory leak
From: Michael Krufky <mkrufky@linuxtv.org> Always call tda829x_release if tda829x_attach fails for a reason other than failure to allocate memory for private structure. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
-rw-r--r--linux/drivers/media/video/tda8290.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/linux/drivers/media/video/tda8290.c b/linux/drivers/media/video/tda8290.c
index 2d019b765..79619cb27 100644
--- a/linux/drivers/media/video/tda8290.c
+++ b/linux/drivers/media/video/tda8290.c
@@ -735,7 +735,7 @@ int tda829x_attach(struct tuner *t)
}
if (tda829x_find_tuner(fe) < 0)
- return -EINVAL;
+ goto fail;
if (priv->ver & TDA8290) {
tda8290_init_tuner(fe);
@@ -748,6 +748,11 @@ int tda829x_attach(struct tuner *t)
t->mode = V4L2_TUNER_ANALOG_TV;
return 0;
+
+fail:
+ tda829x_release(fe);
+ fe->ops.analog_demod_ops = NULL;
+ return -EINVAL;
}
EXPORT_SYMBOL_GPL(tda829x_attach);