Skip to content

Commit

Permalink
[media] ngene: preventing dereferencing a NULL pointer
Browse files Browse the repository at this point in the history
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: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Mauro Carvalho Chehab committed Apr 30, 2015
1 parent f8781a0 commit 5a4faee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/media/pci/ngene/ngene-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5a4faee

Please sign in to comment.