staging: bcm2708_vchiq: fix return value check in vchiq_platform_conn_state_changed()
authorWei Yongjun <weiyongjun1@huawei.com>
Mon, 17 Oct 2016 15:06:07 +0000 (15:06 +0000)
committerJaechul Lee <jcsing.lee@samsung.com>
Fri, 18 Aug 2017 01:04:46 +0000 (10:04 +0900)
In case of error, the function kthread_create() 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 <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c

index e5ab55a9b3994ee30613f16dd1a10be48b173e14..8e79a459220cc032573248f43ba773081220c196 100644 (file)
@@ -2784,7 +2784,7 @@ void vchiq_platform_conn_state_changed(VCHIQ_STATE_T *state,
                                &vchiq_keepalive_thread_func,
                                (void *)state,
                                threadname);
-                       if (arm_state->ka_thread == NULL) {
+                       if (IS_ERR(arm_state->ka_thread)) {
                                vchiq_log_error(vchiq_susp_log_level,
                                        "vchiq: FATAL: couldn't create thread %s",
                                        threadname);