linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 04/26] drivers/scsi/lpfc/lpfc_vport.c: fix read buffer overflow
@ 2010-03-11 22:09 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2010-03-11 22:09 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, roel.kluin, James.Smart, jeykholt

From: Roel Kluin <roel.kluin@gmail.com>

Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: James Smart <James.Smart@Emulex.Com>
Cc: Joe Eykholt <jeykholt@cisco.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/scsi/lpfc/lpfc_vport.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/scsi/lpfc/lpfc_vport.c~drivers-scsi-lpfc-lpfc_vportc-fix-read-buffer-overflow drivers/scsi/lpfc/lpfc_vport.c
--- a/drivers/scsi/lpfc/lpfc_vport.c~drivers-scsi-lpfc-lpfc_vportc-fix-read-buffer-overflow
+++ a/drivers/scsi/lpfc/lpfc_vport.c
@@ -779,7 +779,7 @@ lpfc_destroy_vport_work_array(struct lpf
 	int i;
 	if (vports == NULL)
 		return;
-	for (i = 0; vports[i] != NULL && i <= phba->max_vports; i++)
+	for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++)
 		scsi_host_put(lpfc_shost_from_vport(vports[i]));
 	kfree(vports);
 }
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-11 22:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 22:09 [patch 04/26] drivers/scsi/lpfc/lpfc_vport.c: fix read buffer overflow akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).