media: ddbridge: fix dereference before check
authorDaniel Scheller <d.scheller@gmx.net>
Sat, 12 Aug 2017 11:56:00 +0000 (07:56 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 20 Aug 2017 11:08:53 +0000 (07:08 -0400)
commitfc3fb43e41a15a3508f919a825c186c6e5a22404
treebfe3d2d76a25dafac9ee2c80c2198911c81550ea
parentadb57f60ace633f1ac78cd4e90b7381a9b5abd12
media: ddbridge: fix dereference before check

Both ts_release() and ts_open() can use "output" before check (smatch):

  drivers/media/pci/ddbridge/ddbridge-core.c:816 ts_release() warn: variable dereferenced before check 'output' (see line 809)
  drivers/media/pci/ddbridge/ddbridge-core.c:836 ts_open() warn: variable dereferenced before check 'output' (see line 828)

Fix by performing checks on those pointers.

Cc: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Tested-by: Richard Scobie <r.scobie@clear.net.nz>
Tested-by: Jasmin Jessich <jasmin@anw.at>
Tested-by: Dietmar Spingler <d_spingler@freenet.de>
Tested-by: Manfred Knick <Manfred.Knick@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/pci/ddbridge/ddbridge-core.c