@@ -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);
}
/**
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@broadcom.com> Fixes: cb5b60894602 ("scsi: mpi3mr: Increase maximum number of PHYs to 64 from 32") Signed-off-by: Bart Van Assche <bvanassche@acm.org> --- drivers/scsi/mpi3mr/mpi3mr_transport.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)