media: mtk-mdp: use IS_ERR to check return value of of_clk_get

2017-08-08 Thread Pan Bian
Function of_clk_get() returns an ERR_PTR on failures. In file mtk_mdp_commp.c, its return value is checked against NULL. Such checks cannot prevent from accessing bad memory. This patch replaces the NULL checks with IS_ERR checks. Signed-off-by: Pan Bian <bianpan2...@163.com> --- drivers

[PATCH 1/1] [media] cx25840: fix unchecked return values

2017-04-23 Thread Pan Bian
From: Pan Bian <bianpan2...@163.com> In functions cx25840_initialize(), cx231xx_initialize(), and cx23885_initialize(), the return value of create_singlethread_workqueue() is used without validation. This may result in NULL dereference and cause kernel crash. This patch fixes it. Sign

[PATCH 1/1] [media] cobalt: fix unchecked return values

2017-04-23 Thread Pan Bian
From: Pan Bian <bianpan2...@163.com> 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 <bianpa

[PATCH 1/1] m5602_s5k83a: check return value of kthread_create

2017-04-23 Thread Pan Bian
From: Pan Bian <bianpan2...@163.com> Function kthread_create() returns an ERR_PTR on error. However, in function s5k83a_start(), its return value is used without validation. This may result in a bad memory access bug. This patch fixes the bug. Signed-off-by: Pan Bian <bianpan2..

[PATCH 1/1] media: pci: meye: set error code on failures

2016-12-03 Thread Pan Bian
From: Pan Bian <bianpan2...@163.com> The value of return variable ret is 0 on some error paths, for example, when pci_resource_start() returns a NULL pointer. 0 means no error in this context, which is contrary to the fact. This patch fixes the bug. Bugzilla: https://bugzilla.kern

[PATCH 1/1] media: pci: meye: set error code on failures

2016-12-03 Thread Pan Bian
From: Pan Bian <bianpan2...@163.com> The value of return variable ret is 0 on some error paths, for example, when pci_resource_start() returns a NULL pointer. 0 means no error in this context, which is contrary to the fact. This patch fixes the bug. Bugzilla: https://bugzilla.kern

[PATCH 1/1] media: platform: sti: return -ENOMEM on errors

2016-12-03 Thread Pan Bian
From: Pan Bian <bianpan2...@163.com> Function bdisp_debugfs_create() returns 0 even on errors. So its caller cannot detect the errors. It may be better to return "-ENOMEM" on the exception paths. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188801 Signed-off-by: Pa