提交 5a4faee2 编写于 作者: M Mauro Carvalho Chehab

[media] ngene: preventing dereferencing a NULL pointer

As reported by smatch:
	drivers/media/pci/ngene/ngene-core.c:1529 init_channel() error: we previously assumed 'chan->fe' could be null (see line 1521)
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 f8781a08
......@@ -1526,10 +1526,12 @@ static int init_channel(struct ngene_channel *chan)
if (chan->fe2) {
if (dvb_register_frontend(adapter, chan->fe2) < 0)
goto err;
chan->fe2->tuner_priv = chan->fe->tuner_priv;
memcpy(&chan->fe2->ops.tuner_ops,
&chan->fe->ops.tuner_ops,
sizeof(struct dvb_tuner_ops));
if (chan->fe) {
chan->fe2->tuner_priv = chan->fe->tuner_priv;
memcpy(&chan->fe2->ops.tuner_ops,
&chan->fe->ops.tuner_ops,
sizeof(struct dvb_tuner_ops));
}
}
if (chan->has_demux) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册