From: Nilesh Javali Date: Fri, 16 Dec 2011 09:58:57 +0000 (-0800) Subject: [SCSI] qla4xxx: Break the loop if the sendtargets list was empty X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f1f2e60e1a2320d0ce11102b72b15d5dedb29fe2;p=mv-sheeva.git [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 --- diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 09b28f8513a..ae5d512bf43 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));