From f1f2e60e1a2320d0ce11102b72b15d5dedb29fe2 Mon Sep 17 00:00:00 2001 From: Nilesh Javali Date: Fri, 16 Dec 2011 01:58:57 -0800 Subject: [SCSI] qla4xxx: Break the loop if the sendtargets list was empty Signed-off-by: Nilesh Javali Signed-off-by: Vikas Chaudhary Signed-off-by: James Bottomley --- drivers/scsi/qla4xxx/ql4_os.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/scsi/qla4xxx') diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 09b28f8513a0..ae5d512bf43b 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -4242,6 +4242,9 @@ void qla4xxx_build_ddb_list(struct scsi_qla_host *ha, int is_reset) wtime = jiffies + (HZ * tmo); do { + if (list_empty(&list_st)) + break; + qla4xxx_remove_failed_ddb(ha, &list_st); schedule_timeout_uninterruptible(HZ / 10); } while (time_after(wtime, jiffies)); -- cgit v1.2.3