Skip to content

Commit

Permalink
[SCSI] mpt2sas: fix infinite loop inside config request
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kashyap, Desai authored and James Bottomley committed Aug 13, 2009
1 parent be9e8cd commit 6bd4e1e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/scsi/mpt2sas/mpt2sas_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6bd4e1e

Please sign in to comment.