Commit c34cad87 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

media: saa7164: fix return value check in saa7164_initdev()

commit 89f4d45b 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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Cc: Jianguo Wu <wujianguo@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 96ca9726
...@@ -1386,10 +1386,12 @@ static int __devinit saa7164_initdev(struct pci_dev *pci_dev, ...@@ -1386,10 +1386,12 @@ static int __devinit saa7164_initdev(struct pci_dev *pci_dev,
if (fw_debug) { if (fw_debug) {
dev->kthread = kthread_run(saa7164_thread_function, dev, dev->kthread = kthread_run(saa7164_thread_function, dev,
"saa7164 debug"); "saa7164 debug");
if (!dev->kthread) if (IS_ERR(dev->kthread)) {
dev->kthread = NULL;
printk(KERN_ERR "%s() Failed to create " printk(KERN_ERR "%s() Failed to create "
"debug kernel thread\n", __func__); "debug kernel thread\n", __func__);
} }
}
} /* != BOARD_UNKNOWN */ } /* != BOARD_UNKNOWN */
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment