dtv_demod: Prevent NULL pointer crash caused by tuner attach failure [1/1]

PD#TV-1539

Problem:
Prevent NULL pointer crash caused by tuner attach failure.

Solution:
Prevent NULL pointer crash caused by tuner attach failure.

Verify:
verified by x301

Change-Id: I57cf32947775626467eb952dd2298ae9ec84601d
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
This commit is contained in:
nengwen.chen
2019-03-15 21:50:54 +08:00
committed by Dongjin Kim
parent f47d8a4b00
commit 7c8e554f82
2 changed files with 5 additions and 2 deletions

View File

@@ -280,6 +280,7 @@ static long aml_demod_ioctl(struct file *file,
dvbfe = aml_get_fe();/*get_si2177_tuner();*/
#if 0
if (dvbfe != NULL)
if (dvbfe->ops.tuner_ops.get_strength)
strength = dvbfe->ops.tuner_ops.get_strength(dvbfe);
#else
strength = tuner_get_ch_power2();
@@ -323,7 +324,8 @@ static long aml_demod_ioctl(struct file *file,
#if 0 /*ary temp for my_tool:*/
if (dvbfe != NULL) {
pr_dbg("calling tuner ops\n");
dvbfe->ops.tuner_ops.set_params(dvbfe);
if (dvbfe->ops.tuner_ops.set_params)
dvbfe->ops.tuner_ops.set_params(dvbfe);
}
#endif
break;

View File

@@ -3828,7 +3828,8 @@ static int delsys_set(struct dvb_frontend *fe, unsigned int delsys)
else if (mode == AM_FE_ISDBT_N)
fe->ops.info.type = FE_ISDBT;
fe->ops.tuner_ops.set_config(fe, NULL);
if (fe->ops.tuner_ops.set_config)
fe->ops.tuner_ops.set_config(fe, NULL);
return 0;
}