scsi: mpi3mr: Reduce stack usage
Subsystems (2)
PATCH 1/1 scsi: mpi3mr: Reduce stack usage
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 <[email protected]>
Fixes cb5b60894602 ("scsi: mpi3mr: Increase maximum number of PHYs to 64 from 32")
Signed-off-by Bart Van Assche <[email protected]>
--- drivers/scsi/mpi3mr/mpi3mr_transport.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/scsi/mpi3mr/mpi3mr_transport.c +5 -1
@@ -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); }/**
Quoted 1 line · Bart Van Assche
Fix the following build error: [ ... ]
Please help with reviewing this patch.
Thanks,
Bart.
Bart,
Quoted 3 lines
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=]
Already addressed by:
5cc2da0b60e5 ("scsi: mpi3mr: Reduce stack usage in mpi3mr_refresh_sas_ports()")
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering