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-Url: https://git.stricted.de/?a=commitdiff_plain;h=6690e0d4fc5cccf74534abe0c9f9a69032bc02f0;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git lpfc: Fix driver crash when module parameter lpfc_fcp_io_channel set to 16 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 --- diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index db9446c612da..5915407d19aa 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -8833,9 +8833,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; }