Skip to content

Commit 6cd23a0

Browse files
Malcolm Priestleygregkh
Malcolm Priestley
authored andcommitted
media: dvb-usb-v2: lmedm04: move ts2020 attach to dm04_lme2510_tuner
commit 7bf7a7116ed313c601307f7e585419369926ab05 upstream. When the tuner was split from m88rs2000 the attach function is in wrong place. Move to dm04_lme2510_tuner to trap errors on failure and removing a call to lme_coldreset. Prevents driver starting up without any tuner connected. Fixes to trap for ts2020 fail. LME2510(C): FE Found M88RS2000 ts2020: probe of 0-0060 failed with error -11 ... LME2510(C): TUN Found RS2000 tuner kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN Reported-by: Andrey Konovalov <[email protected]> Signed-off-by: Malcolm Priestley <[email protected]> Tested-by: Andrey Konovalov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Cc: Ben Hutchings <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8488242 commit 6cd23a0

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/media/usb/dvb-usb-v2/lmedm04.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -1118,8 +1118,6 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
11181118

11191119
if (adap->fe[0]) {
11201120
info("FE Found M88RS2000");
1121-
dvb_attach(ts2020_attach, adap->fe[0], &ts2020_config,
1122-
&d->i2c_adap);
11231121
st->i2c_tuner_gate_w = 5;
11241122
st->i2c_tuner_gate_r = 5;
11251123
st->i2c_tuner_addr = 0x60;
@@ -1182,17 +1180,18 @@ static int dm04_lme2510_tuner(struct dvb_usb_adapter *adap)
11821180
ret = st->tuner_config;
11831181
break;
11841182
case TUNER_RS2000:
1185-
ret = st->tuner_config;
1183+
if (dvb_attach(ts2020_attach, adap->fe[0],
1184+
&ts2020_config, &d->i2c_adap))
1185+
ret = st->tuner_config;
11861186
break;
11871187
default:
11881188
break;
11891189
}
11901190

1191-
if (ret)
1191+
if (ret) {
11921192
info("TUN Found %s tuner", tun_msg[ret]);
1193-
else {
1194-
info("TUN No tuner found --- resetting device");
1195-
lme_coldreset(d);
1193+
} else {
1194+
info("TUN No tuner found");
11961195
return -ENODEV;
11971196
}
11981197

0 commit comments

Comments
 (0)