summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-frontends/m88ds3103.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2023-10-30 08:20:26 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-12-13 11:04:46 +0100
commit5b2f885e2f6f482d05c23f04c8240f7b4fc5bdb5 (patch)
tree423dab278dbc4f26c736c1eec15e77c0c2ae7515 /drivers/media/dvb-frontends/m88ds3103.c
parenta2dd235df435a05d389240be748909ada91201d2 (diff)
media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe()
If an error occurs after a successful i2c_mux_add_adapter(), then i2c_mux_del_adapters() should be called to free some resources, as already done in the remove function. Fixes: e6089feca460 ("media: m88ds3103: Add support for ds3103b demod") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/dvb-frontends/m88ds3103.c')
-rw-r--r--drivers/media/dvb-frontends/m88ds3103.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c
index 26c67ef05d13..e0272054fca5 100644
--- a/drivers/media/dvb-frontends/m88ds3103.c
+++ b/drivers/media/dvb-frontends/m88ds3103.c
@@ -1894,7 +1894,7 @@ static int m88ds3103_probe(struct i2c_client *client)
/* get frontend address */
ret = regmap_read(dev->regmap, 0x29, &utmp);
if (ret)
- goto err_kfree;
+ goto err_del_adapters;
dev->dt_addr = ((utmp & 0x80) == 0) ? 0x42 >> 1 : 0x40 >> 1;
dev_dbg(&client->dev, "dt addr is 0x%02x\n", dev->dt_addr);
@@ -1902,11 +1902,14 @@ static int m88ds3103_probe(struct i2c_client *client)
dev->dt_addr);
if (IS_ERR(dev->dt_client)) {
ret = PTR_ERR(dev->dt_client);
- goto err_kfree;
+ goto err_del_adapters;
}
}
return 0;
+
+err_del_adapters:
+ i2c_mux_del_adapters(dev->muxc);
err_kfree:
kfree(dev);
err: