]> git.hungrycats.org Git - linux/commitdiff
SCSI: mpt2sas: fix infinite loop inside config request
authorKashyap, Desai <kashyap.desai@lsi.com>
Fri, 7 Aug 2009 14:07:14 +0000 (19:37 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 9 Sep 2009 03:33:43 +0000 (20:33 -0700)
commit 6bd4e1e4d6023f4da069fd68729c502cc4e6dfd0 upstream.

This restriction is introduced just to avoid loop of
config_request. Retry must be limited so we have restricted
config request to maximum 2 times.

Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/scsi/mpt2sas/mpt2sas_config.c

index 58cfb97846f7e292a5c30a34b1e44c7cce876824..1c6658c60239a2ce0fde2d608cbb48abc0abae02 100644 (file)
@@ -247,6 +247,12 @@ _config_request(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigRequest_t
        retry_count = 0;
 
  retry_config:
+       if (retry_count) {
+               if (retry_count > 2) /* attempt only 2 retries */
+                       return -EFAULT;
+               printk(MPT2SAS_INFO_FMT "%s: attempting retry (%d)\n",
+                   ioc->name, __func__, retry_count);
+       }
        wait_state_count = 0;
        ioc_state = mpt2sas_base_get_iocstate(ioc, 1);
        while (ioc_state != MPI2_IOC_STATE_OPERATIONAL) {