Skip to content

Commit 7fd6644

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Two small fixes, all in drivers (the more obsolete mpt3sas and the newer mpi3mr)" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: mpt3sas: Prevent sending diag_reset when the controller is ready scsi: mpi3mr: Reduce stack usage in mpi3mr_refresh_sas_ports()
2 parents 5ad3cb0 + ee0017c commit 7fd6644

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

drivers/scsi/mpi3mr/mpi3mr_transport.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,7 @@ mpi3mr_update_mr_sas_port(struct mpi3mr_ioc *mrioc, struct host_port *h_port,
16711671
void
16721672
mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc)
16731673
{
1674-
struct host_port h_port[64];
1674+
struct host_port *h_port = NULL;
16751675
int i, j, found, host_port_count = 0, port_idx;
16761676
u16 sz, attached_handle, ioc_status;
16771677
struct mpi3_sas_io_unit_page0 *sas_io_unit_pg0 = NULL;
@@ -1685,6 +1685,10 @@ mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc)
16851685
sas_io_unit_pg0 = kzalloc(sz, GFP_KERNEL);
16861686
if (!sas_io_unit_pg0)
16871687
return;
1688+
h_port = kcalloc(64, sizeof(struct host_port), GFP_KERNEL);
1689+
if (!h_port)
1690+
goto out;
1691+
16881692
if (mpi3mr_cfg_get_sas_io_unit_pg0(mrioc, sas_io_unit_pg0, sz)) {
16891693
ioc_err(mrioc, "failure at %s:%d/%s()!\n",
16901694
__FILE__, __LINE__, __func__);
@@ -1814,6 +1818,7 @@ mpi3mr_refresh_sas_ports(struct mpi3mr_ioc *mrioc)
18141818
}
18151819
}
18161820
out:
1821+
kfree(h_port);
18171822
kfree(sas_io_unit_pg0);
18181823
}
18191824

drivers/scsi/mpt3sas/mpt3sas_base.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7378,7 +7378,9 @@ _base_wait_for_iocstate(struct MPT3SAS_ADAPTER *ioc, int timeout)
73787378
return -EFAULT;
73797379
}
73807380

7381-
issue_diag_reset:
7381+
return 0;
7382+
7383+
issue_diag_reset:
73827384
rc = _base_diag_reset(ioc);
73837385
return rc;
73847386
}

0 commit comments

Comments
 (0)