kernel_optimize_test/drivers/media/dvb-frontends
Zhou Qingyang df79d2bf95 media: dib8000: Fix a memleak in dib8000_init()
[ Upstream commit 8dbdcc7269a83305ee9d677b75064d3530a48ee2 ]

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 10:53:54 +01:00
..
cxd2880
drx39xyj treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
a8293.c
a8293.h
af9013_priv.h
af9013.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
af9013.h
af9033_priv.h
af9033.c
af9033.h
as102_fe_types.h
as102_fe.c
as102_fe.h
ascot2e.c
ascot2e.h
atbm8830_priv.h
atbm8830.c
atbm8830.h
au8522_common.c
au8522_decoder.c
au8522_dig.c
au8522_priv.h
au8522.h
bcm3510_priv.h
bcm3510.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
bcm3510.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
cxd2099.c
cxd2099.h
cxd2820r_c.c
cxd2820r_core.c
cxd2820r_priv.h
cxd2820r_t.c
cxd2820r_t2.c
cxd2820r.h
cxd2841er_priv.h
cxd2841er.c
cxd2841er.h
dib0070.c
dib0070.h
dib0090.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
dib0090.h
dib3000.h
dib3000mb_priv.h
dib3000mb.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
dib3000mc.c
dib3000mc.h
dib7000m.c
dib7000m.h
dib7000p.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
dib7000p.h
dib8000.c media: dib8000: Fix a memleak in dib8000_init() 2022-01-27 10:53:54 +01:00
dib8000.h
dib9000.c
dib9000.h
dibx000_common.c
dibx000_common.h
drxd_firm.c
drxd_firm.h
drxd_hard.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
drxd_map_firm.h
drxd.h
drxk_hard.c media: dvb-frontends/drxk_hard.c: fix uninitialized variable warning 2020-10-08 14:15:14 +02:00
drxk_hard.h
drxk_map.h
drxk.h
ds3000.c
ds3000.h
dvb_dummy_fe.c
dvb_dummy_fe.h
dvb-pll.c
dvb-pll.h
ec100.c
ec100.h
eds1547.h
gp8psk-fe.c
gp8psk-fe.h
helene.c
helene.h
horus3a.c
horus3a.h
isl6405.c
isl6405.h
isl6421.c
isl6421.h
isl6423.c
isl6423.h
itd1000_priv.h
itd1000.c
itd1000.h
ix2505v.c
ix2505v.h
Kconfig
l64781.c
l64781.h
lg2160.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
lg2160.h
lgdt330x_priv.h
lgdt330x.c
lgdt330x.h
lgdt3305.c
lgdt3305.h
lgdt3306a.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
lgdt3306a.h
lgs8gl5.c
lgs8gl5.h
lgs8gxx_priv.h
lgs8gxx.c
lgs8gxx.h
lnbh24.h
lnbh25.c
lnbh25.h
lnbh29.c
lnbh29.h
lnbp21.c
lnbp21.h
lnbp22.c
lnbp22.h
m88ds3103_priv.h
m88ds3103.c media: m88ds3103: fix return value check in m88ds3103_probe() 2021-05-14 09:50:23 +02:00
m88ds3103.h
m88rs2000.c
m88rs2000.h
Makefile
mb86a16_priv.h
mb86a16.c media: dvb-frontends: mb86a16.c: remove useless if/else 2020-08-29 08:02:46 +02:00
mb86a16.h
mb86a20s.c
mb86a20s.h
mn88443x.c media: dvb-frontends: mn88443x: Handle errors of clk_prepare_enable() 2021-11-18 14:04:06 +01:00
mn88443x.h
mn88472_priv.h
mn88472.c
mn88472.h
mn88473_priv.h
mn88473.c
mn88473.h
mt312_priv.h
mt312.c
mt312.h
mt352_priv.h
mt352.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mt352.h
mxl5xx_defs.h
mxl5xx_regs.h
mxl5xx.c Linux 5.9-rc4 2020-09-07 16:13:06 +02:00
mxl5xx.h
nxt200x.c
nxt200x.h
nxt6000_priv.h
nxt6000.c
nxt6000.h
or51132.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
or51132.h
or51211.c
or51211.h
rtl2830_priv.h
rtl2830.c
rtl2830.h
rtl2832_priv.h
rtl2832_sdr.c media: dvb-frontends: rtl2832_sdr: set error code in probe 2020-09-27 11:23:46 +02:00
rtl2832_sdr.h
rtl2832.c
rtl2832.h
s5h1409.c
s5h1409.h
s5h1411.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
s5h1411.h
s5h1420_priv.h
s5h1420.c
s5h1420.h
s5h1432.c
s5h1432.h
s921.c
s921.h
si21xx.c
si21xx.h
si2165_priv.h
si2165.c
si2165.h
si2168_priv.h
si2168.c
si2168.h
sp2_priv.h
sp2.c
sp2.h
sp887x.c
sp887x.h
sp8870.c media: dvb: Add check on sp8870_readreg return 2021-06-03 09:00:42 +02:00
sp8870.h
stb0899_algo.c
stb0899_cfg.h
stb0899_drv.c
stb0899_drv.h
stb0899_priv.h
stb0899_reg.h
stb6000.c
stb6000.h
stb6100_cfg.h
stb6100_proc.h
stb6100.c
stb6100.h
stv090x_priv.h
stv090x_reg.h
stv090x.c
stv090x.h
stv0288.c
stv0288.h
stv0297.c
stv0297.h
stv0299.c
stv0299.h
stv0367_defs.h
stv0367_priv.h
stv0367_regs.h
stv0367.c
stv0367.h
stv0900_core.c
stv0900_init.h
stv0900_priv.h
stv0900_reg.h
stv0900_sw.c
stv0900.h
stv0910_regs.h
stv0910.c
stv0910.h
stv6110.c
stv6110.h
stv6110x_priv.h
stv6110x_reg.h
stv6110x.c
stv6110x.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_cfg.h
tda8261.c
tda8261.h
tda10021.c media: tda10021: avoid casts when using symbol_rate 2020-09-03 11:11:03 +02:00
tda10023.c
tda10048.c
tda10048.h
tda10071_priv.h
tda10071.c
tda10071.h
tda10086.c media: tda10086: cleanup symbol_rate setting logic 2020-09-03 11:07:28 +02:00
tda10086.h
tda18271c2dd_maps.h media: dvb-frontends: tda18271c2dd: Constify static structs 2020-09-27 11:26:00 +02:00
tda18271c2dd.c media: dvb-frontends: tda18271c2dd: Constify static structs 2020-09-27 11:26:00 +02:00
tda18271c2dd.h
tdhd1.h
ts2020.c
ts2020.h
tua6100.c
tua6100.h
ves1x93.c
ves1x93.h
ves1820.c
ves1820.h
z0194a.h
zd1301_demod.c
zd1301_demod.h media: dvb-frontends: remove a clone of a kernel-doc markup at zd1301_demod.h 2020-09-30 18:50:20 +02:00
zl10036.c
zl10036.h
zl10039.c
zl10039.h
zl10353_priv.h
zl10353.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
zl10353.h