linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [SCSI] hpsa: fix return value check in start_controller_lockup_detector()
@ 2013-10-29  6:43 Wei Yongjun
  2013-10-29 16:09 ` scameron
  0 siblings, 1 reply; 4+ messages in thread
From: Wei Yongjun @ 2013-10-29  6:43 UTC (permalink / raw)
  To: scameron, JBottomley; +Cc: yongjun_wei, iss_storagedev, linux-scsi

From: Wei Yongjun <yongjun_wei@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_wei@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;


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-30 13:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-29  6:43 [PATCH] [SCSI] hpsa: fix return value check in start_controller_lockup_detector() Wei Yongjun
2013-10-29 16:09 ` scameron
2013-10-29 21:52   ` James Bottomley
2013-10-30 13:33     ` scameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).