linux-stable/drivers/media/dvb-frontends
Zhou Qingyang 9976f17614 media: dib8000: Fix a memleak in dib8000_init()
[ Upstream commit 8dbdcc7269 ]

In dib8000_init(), the variable fe is not freed or passed out on the
failure of dib8000_identify(&state->i2c), which could lead to a memleak.

Fix this bug by adding a kfree of fe in the error path.

This bug was found by a static analyzer. The analysis employs
differential checking to identify inconsistent security operations
(e.g., checks or kfrees) between two code paths and confirms that the
inconsistent operations are not recovered in the current function or
the callers, so they constitute bugs.

Note that, as a bug found by static analysis, it can be a false
positive or hard to trigger. Multiple researchers have cross-reviewed
the bug.

Builds with CONFIG_DVB_DIB8000=m show no new warnings,
and our static analyzer no longer warns about this code.

Fixes: 77e2c0f5d4 ("V4L/DVB (12900): DiB8000: added support for DiBcom ISDB-T/ISDB-Tsb demodulator DiB8000")
Signed-off-by: Zhou Qingyang <zhou1615@umn.edu>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 09:00:50 +01:00
..
drx39xyj
a8293.c
a8293.h
af9013.c
af9013.h
af9013_priv.h
af9033.c
af9033.h
af9033_priv.h
as102_fe.c
as102_fe.h
as102_fe_types.h
ascot2e.c media: dvb-frontends: fix i2c access helpers for KASAN 2018-02-16 20:23:04 +01:00
ascot2e.h
atbm8830.c
atbm8830.h
atbm8830_priv.h
au8522.h
au8522_common.c
au8522_decoder.c
au8522_dig.c
au8522_priv.h
bcm3510.c
bcm3510.h
bcm3510_priv.h
bsbe1-d01a.h
bsbe1.h
bsru6.h
cx22700.c
cx22700.h
cx22702.c
cx22702.h
cx24110.c
cx24110.h
cx24113.c
cx24113.h
cx24116.c
cx24116.h
cx24117.c
cx24117.h
cx24120.c
cx24120.h
cx24123.c
cx24123.h
cxd2820r.h
cxd2820r_c.c
cxd2820r_core.c
cxd2820r_priv.h
cxd2820r_t.c
cxd2820r_t2.c
cxd2841er.c media: dvb-frontends: fix i2c access helpers for KASAN 2018-02-16 20:23:04 +01:00
cxd2841er.h
cxd2841er_priv.h
dib0070.c
dib0070.h
dib0090.c media: dib0090: fix duplicated code for different branches 2017-08-27 07:51:30 -04:00
dib0090.h
dib3000.h
dib3000mb.c
dib3000mb_priv.h
dib3000mc.c media: dvb: i2c transfers over usb cannot be done from stack 2017-09-23 07:21:33 -04:00
dib3000mc.h
dib7000m.c
dib7000m.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dib7000p.c
dib7000p.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dib8000.c media: dib8000: Fix a memleak in dib8000_init() 2022-01-27 09:00:50 +01:00
dib8000.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dib9000.c media: dib9000: delete some unused broken code 2017-08-27 08:46:42 -04:00
dib9000.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dibx000_common.c
dibx000_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
drxd.h
drxd_firm.c
drxd_firm.h
drxd_hard.c
drxd_map_firm.h
drxk.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
drxk_hard.c
drxk_hard.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
drxk_map.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ds3000.c
ds3000.h
dvb-pll.c media: dvb: i2c transfers over usb cannot be done from stack 2017-09-23 07:21:33 -04:00
dvb-pll.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dvb_dummy_fe.c
dvb_dummy_fe.h
ec100.c
ec100.h
eds1547.h
gp8psk-fe.c
gp8psk-fe.h
helene.c media: helene: fix xtal frequency setting at power on 2018-09-19 22:43:44 +02:00
helene.h
horus3a.c media: dvb-frontends: fix i2c access helpers for KASAN 2018-02-16 20:23:04 +01:00
horus3a.h
isl6405.c
isl6405.h
isl6421.c media: isl6421: add checks for current overflow 2017-08-20 10:20:30 -04:00
isl6421.h
isl6423.c
isl6423.h
itd1000.c media: dvb-frontends: fix i2c access helpers for KASAN 2018-02-16 20:23:04 +01:00
itd1000.h
itd1000_priv.h
ix2505v.c
ix2505v.h
Kconfig
l64781.c
l64781.h
lg2160.c
lg2160.h
lgdt330x.c
lgdt330x.h
lgdt330x_priv.h
lgdt3305.c
lgdt3305.h
lgdt3306a.c media: lgdt3306a: Fix a double kfree on i2c device remove 2018-05-25 16:17:56 +02:00
lgdt3306a.h
lgs8gl5.c
lgs8gl5.h
lgs8gxx.c
lgs8gxx.h
lgs8gxx_priv.h
lnbh24.h
lnbh25.c
lnbh25.h
lnbp21.c
lnbp21.h
lnbp22.c
lnbp22.h
m88ds3103.c media: m88ds3103: serialize reset messages in m88ds3103_set_frontend 2019-05-31 06:47:34 -07:00
m88ds3103.h
m88ds3103_priv.h
m88rs2000.c
m88rs2000.h
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mb86a16.c
mb86a16.h
mb86a16_priv.h
mb86a20s.c
mb86a20s.h
mn88472.c media: mn88472: reset stream ID reg if no PLP given 2017-08-27 18:06:34 -04:00
mn88472.h
mn88472_priv.h
mn88473.c media: mn88473: reset stream ID reg if no PLP given 2017-08-27 18:06:52 -04:00
mn88473.h
mn88473_priv.h
mt312.c media: dvb-frontends: fix i2c access helpers for KASAN 2018-02-16 20:23:04 +01:00
mt312.h
mt312_priv.h
mt352.c
mt352.h
mt352_priv.h
mxl5xx.c
mxl5xx.h
mxl5xx_defs.h
mxl5xx_regs.h
nxt200x.c
nxt200x.h
nxt6000.c
nxt6000.h
nxt6000_priv.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
or51132.c
or51132.h
or51211.c
or51211.h
rtl2830.c
rtl2830.h
rtl2830_priv.h
rtl2832.c
rtl2832.h
rtl2832_priv.h
rtl2832_sdr.c
rtl2832_sdr.h
s5h1409.c
s5h1409.h
s5h1411.c
s5h1411.h
s5h1420.c
s5h1420.h
s5h1420_priv.h
s5h1432.c
s5h1432.h
s921.c
s921.h
si21xx.c
si21xx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
si2165.c
si2165.h
si2165_priv.h
si2168.c media: [RESEND] media: dvb-frontends: Add delay to Si2168 restart 2018-03-24 11:01:23 +01:00
si2168.h
si2168_priv.h
sp2.c
sp2.h
sp2_priv.h
sp887x.c
sp887x.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sp8870.c media: dvb: Add check on sp8870_readreg return 2021-06-03 08:36:21 +02:00
sp8870.h
stb0899_algo.c
stb0899_cfg.h
stb0899_drv.c media: dvb-frontends: fix i2c access helpers for KASAN 2018-02-16 20:23:04 +01:00
stb0899_drv.h
stb0899_priv.h
stb0899_reg.h
stb6000.c
stb6000.h
stb6100.c media: dvb-frontends: fix i2c access helpers for KASAN 2018-02-16 20:23:04 +01:00
stb6100.h
stb6100_cfg.h
stb6100_proc.h
stv090x.c media: dvb-frontends: fix i2c access helpers for KASAN 2018-02-16 20:23:04 +01:00
stv090x.h
stv090x_priv.h
stv090x_reg.h
stv0288.c
stv0288.h
stv0297.c
stv0297.h
stv0299.c
stv0299.h
stv0367.c media: dvb-frontends: fix i2c access helpers for KASAN 2018-02-16 20:23:04 +01:00
stv0367.h
stv0367_defs.h
stv0367_priv.h
stv0367_regs.h
stv0900.h
stv0900_core.c
stv0900_init.h
stv0900_priv.h
stv0900_reg.h
stv0900_sw.c
stv0910.c media: dvb-frontends/stv0910: change minsymrate to 100Ksyms/s 2017-08-27 06:42:53 -04:00
stv0910.h
stv0910_regs.h
stv6110.c
stv6110.h
stv6110x.c media: dvb-frontends: fix i2c access helpers for KASAN 2018-02-16 20:23:04 +01:00
stv6110x.h
stv6110x_priv.h
stv6110x_reg.h
stv6111.c
stv6111.h
tc90522.c
tc90522.h
tda665x.c
tda665x.h
tda826x.c
tda826x.h
tda1002x.h
tda1004x.c
tda1004x.h
tda8083.c
tda8083.h
tda8261.c
tda8261.h
tda8261_cfg.h
tda10021.c
tda10023.c
tda10048.c
tda10048.h
tda10071.c media: tda10071: fix unsigned sign extension overflow 2020-10-01 13:12:37 +02:00
tda10071.h
tda10071_priv.h
tda10086.c
tda10086.h
tda18271c2dd.c
tda18271c2dd.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tda18271c2dd_maps.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tdhd1.h
ts2020.c media: ts2020: avoid integer overflows on 32 bit machines 2018-02-16 20:23:05 +01:00
ts2020.h
tua6100.c tua6100: Avoid build warnings. 2019-07-31 07:28:22 +02:00
tua6100.h
ves1x93.c
ves1x93.h
ves1820.c
ves1820.h
z0194a.h
zd1301_demod.c
zd1301_demod.h
zl10036.c
zl10036.h
zl10039.c media: dvb-frontends: fix i2c access helpers for KASAN 2018-02-16 20:23:04 +01:00
zl10039.h
zl10353.c
zl10353.h
zl10353_priv.h