mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe()
[ Upstream commit5b2f885e2f
] 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:e6089feca4
("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
74e3f165d3
commit
2db7760422
1 changed files with 5 additions and 2 deletions
|
@ -1894,7 +1894,7 @@ static int m88ds3103_probe(struct i2c_client *client,
|
||||||
/* get frontend address */
|
/* get frontend address */
|
||||||
ret = regmap_read(dev->regmap, 0x29, &utmp);
|
ret = regmap_read(dev->regmap, 0x29, &utmp);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_kfree;
|
goto err_del_adapters;
|
||||||
dev->dt_addr = ((utmp & 0x80) == 0) ? 0x42 >> 1 : 0x40 >> 1;
|
dev->dt_addr = ((utmp & 0x80) == 0) ? 0x42 >> 1 : 0x40 >> 1;
|
||||||
dev_dbg(&client->dev, "dt addr is 0x%02x\n", dev->dt_addr);
|
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);
|
dev->dt_addr);
|
||||||
if (IS_ERR(dev->dt_client)) {
|
if (IS_ERR(dev->dt_client)) {
|
||||||
ret = PTR_ERR(dev->dt_client);
|
ret = PTR_ERR(dev->dt_client);
|
||||||
goto err_kfree;
|
goto err_del_adapters;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
err_del_adapters:
|
||||||
|
i2c_mux_del_adapters(dev->muxc);
|
||||||
err_kfree:
|
err_kfree:
|
||||||
kfree(dev);
|
kfree(dev);
|
||||||
err:
|
err:
|
||||||
|
|
Loading…
Reference in a new issue