diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-10-25 05:34:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-20 10:45:10 -0500 |
commit | ec0593f929cd58143998f42263d74b10c203d393 (patch) | |
tree | 530eab7dba67b66ccd8ad6142231b543261f77d1 /drivers/media/pci | |
parent | ac6d0ecfef36956cb0549c89398e5f7e1e84e658 (diff) |
media: saa7164: fix return value check in saa7164_initdev()
commit 89f4d45b2752df5d222b5f63919ce59e2d8afaf4 upstream.
In case of error, the function kthread_run() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/saa7164/saa7164-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c index 7618fdae811e..62141b8f1e1a 100644 --- a/drivers/media/pci/saa7164/saa7164-core.c +++ b/drivers/media/pci/saa7164/saa7164-core.c | |||
@@ -1348,9 +1348,11 @@ static int saa7164_initdev(struct pci_dev *pci_dev, | |||
1348 | if (fw_debug) { | 1348 | if (fw_debug) { |
1349 | dev->kthread = kthread_run(saa7164_thread_function, dev, | 1349 | dev->kthread = kthread_run(saa7164_thread_function, dev, |
1350 | "saa7164 debug"); | 1350 | "saa7164 debug"); |
1351 | if (!dev->kthread) | 1351 | if (IS_ERR(dev->kthread)) { |
1352 | dev->kthread = NULL; | ||
1352 | printk(KERN_ERR "%s() Failed to create " | 1353 | printk(KERN_ERR "%s() Failed to create " |
1353 | "debug kernel thread\n", __func__); | 1354 | "debug kernel thread\n", __func__); |
1355 | } | ||
1354 | } | 1356 | } |
1355 | 1357 | ||
1356 | } /* != BOARD_UNKNOWN */ | 1358 | } /* != BOARD_UNKNOWN */ |