Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: bcm2708_vchiq: fix return value check in vchiq_init_state()

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>

authored by

Wei Yongjun and committed by
Greg Kroah-Hartman
d298ec65 b04451d7

+3 -3
+3 -3
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
··· 2440 2440 (void *)state, 2441 2441 threadname); 2442 2442 2443 - if (state->slot_handler_thread == NULL) { 2443 + if (IS_ERR(state->slot_handler_thread)) { 2444 2444 vchiq_loud_error_header(); 2445 2445 vchiq_loud_error("couldn't create thread %s", threadname); 2446 2446 vchiq_loud_error_footer(); ··· 2453 2453 state->recycle_thread = kthread_create(&recycle_func, 2454 2454 (void *)state, 2455 2455 threadname); 2456 - if (state->recycle_thread == NULL) { 2456 + if (IS_ERR(state->recycle_thread)) { 2457 2457 vchiq_loud_error_header(); 2458 2458 vchiq_loud_error("couldn't create thread %s", threadname); 2459 2459 vchiq_loud_error_footer(); ··· 2466 2466 state->sync_thread = kthread_create(&sync_func, 2467 2467 (void *)state, 2468 2468 threadname); 2469 - if (state->sync_thread == NULL) { 2469 + if (IS_ERR(state->sync_thread)) { 2470 2470 vchiq_loud_error_header(); 2471 2471 vchiq_loud_error("couldn't create thread %s", threadname); 2472 2472 vchiq_loud_error_footer();