From: James Smart Date: Wed, 16 Dec 2015 23:11:56 +0000 (-0500) Subject: lpfc: Fix driver crash when module parameter lpfc_fcp_io_channel set to 16 X-Git-Tag: firefly_0821_release~176^2~4^2~31^2~142 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7cf5c223ccf949e6d5ef6b87c33edcad67a8ebbe;p=firefly-linux-kernel-4.4.55.git lpfc: Fix driver crash when module parameter lpfc_fcp_io_channel set to 16 [ Upstream commit 6690e0d4fc5cccf74534abe0c9f9a69032bc02f0 ] Fix driver crash when module parameter lpfc_fcp_io_channel set to 16 Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinicke Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index b0d92b84bcdc..c14ab6c3ae40 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -8834,9 +8834,12 @@ found: * already mapped to this phys_id. */ if (cpup->irq != LPFC_VECTOR_MAP_EMPTY) { - chann[saved_chann] = - cpup->channel_id; - saved_chann++; + if (saved_chann <= + LPFC_FCP_IO_CHAN_MAX) { + chann[saved_chann] = + cpup->channel_id; + saved_chann++; + } goto out; }