[media] cobalt: fix unchecked return values
authorPan Bian <bianpan2016@163.com>
Sun, 23 Apr 2017 12:18:29 +0000 (09:18 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 6 Jun 2017 10:29:15 +0000 (07:29 -0300)
commitb9150e8131914df75d396a5730a599d358f016d8
tree653de1141824cf79a85814bb054c1a538966d64a
parent13174c388a76005c1abe454e47a37cd57edd8c8d
[media] cobalt: fix unchecked return values

Function pci_find_ext_capability() may return 0, which is an invalid
address. In function cobalt_pcie_status_show(), its return value is used
without validation. This patch adds checks to validate the return
address.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/pci/cobalt/cobalt-driver.c