diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_ct.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_ct.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 50f45339e0c0..48ae2355de69 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c | |||
@@ -334,22 +334,22 @@ lpfc_ns_rsp(struct lpfc_hba * phba, struct lpfc_dmabuf * mp, uint32_t Size) | |||
334 | 334 | ||
335 | lpfc_set_disctmo(phba); | 335 | lpfc_set_disctmo(phba); |
336 | 336 | ||
337 | Cnt = Size > FCELSSIZE ? FCELSSIZE : Size; | ||
338 | 337 | ||
339 | list_add_tail(&head, &mp->list); | 338 | list_add_tail(&head, &mp->list); |
340 | list_for_each_entry_safe(mp, next_mp, &head, list) { | 339 | list_for_each_entry_safe(mp, next_mp, &head, list) { |
341 | mlast = mp; | 340 | mlast = mp; |
342 | 341 | ||
342 | Cnt = Size > FCELSSIZE ? FCELSSIZE : Size; | ||
343 | |||
343 | Size -= Cnt; | 344 | Size -= Cnt; |
344 | 345 | ||
345 | if (!ctptr) { | 346 | if (!ctptr) { |
346 | Cnt = FCELSSIZE; | ||
347 | ctptr = (uint32_t *) mlast->virt; | 347 | ctptr = (uint32_t *) mlast->virt; |
348 | } else | 348 | } else |
349 | Cnt -= 16; /* subtract length of CT header */ | 349 | Cnt -= 16; /* subtract length of CT header */ |
350 | 350 | ||
351 | /* Loop through entire NameServer list of DIDs */ | 351 | /* Loop through entire NameServer list of DIDs */ |
352 | while (Cnt) { | 352 | while (Cnt >= sizeof (uint32_t)) { |
353 | 353 | ||
354 | /* Get next DID from NameServer List */ | 354 | /* Get next DID from NameServer List */ |
355 | CTentry = *ctptr++; | 355 | CTentry = *ctptr++; |