From: Wei Yongjun <yongjun_...@trendmicro.com.cn>

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_...@trendmicro.com.cn>
---
 drivers/scsi/hpsa.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 891c86b..f413b14 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4757,7 +4757,8 @@ static void start_controller_lockup_detector(struct 
ctlr_info *h)
                        kthread_run(detect_controller_lockup_thread,
                                                NULL, HPSA);
        }
-       if (!hpsa_lockup_detector) {
+       if (IS_ERR(hpsa_lockup_detector)) {
+               hpsa_lockup_detector = NULL;
                dev_warn(&h->pdev->dev,
                        "Could not start lockup detector thread\n");
                return;

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to