Fix the following build error: drivers/scsi/mpi3mr/mpi3mr_transport.c:1818:1: error: the frame size of 1640 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] Cc: Sumit Saxena <sumit.saxena@xxxxxxxxxxxx> Fixes: cb5b60894602 ("scsi: mpi3mr: Increase maximum number of PHYs to 64 from 32") Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> --- drivers/scsi/mpi3mr/mpi3mr_transport.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c index c0c8ab586957..0fe6f0c108e9 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_transport.c +++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c @@ -1671,7 +1671,7 @@ mpi3mr_update_mr_sas_port(struct mpi3mr_ioc *mrioc, struct host_port *h_port, void mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc) { - struct host_port h_port[64]; + struct host_port *h_port; int i, j, found, host_port_count = 0, port_idx; u16 sz, attached_handle, ioc_status; struct mpi3_sas_io_unit_page0 *sas_io_unit_pg0 = NULL; @@ -1679,6 +1679,9 @@ mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc) struct mpi3_device0_sas_sata_format *sasinf; struct mpi3mr_sas_port *mr_sas_port; + h_port = kcalloc(64, sizeof(*h_port), GFP_KERNEL); + if (!h_port) + goto out; sz = offsetof(struct mpi3_sas_io_unit_page0, phy_data) + (mrioc->sas_hba.num_phys * sizeof(struct mpi3_sas_io_unit0_phy_data)); @@ -1815,6 +1818,7 @@ mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc) } out: kfree(sas_io_unit_pg0); + kfree(h_port); } /**