diff mbox series

scsi: mpi3mr: fix an issue found by KASAN

Message ID 20230213193752.6859-1-thenzl@redhat.com
State New
Headers show
Series scsi: mpi3mr: fix an issue found by KASAN | expand

Commit Message

Tomas Henzl Feb. 13, 2023, 7:37 p.m. UTC
Write only correct size (32 instead of 64 bytes).

Fixes: 42fc9fee116fc ("scsi: mpi3mr: Add helper functions to manage device's port")
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
---
 drivers/scsi/mpi3mr/mpi3mr_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sathya Prakash Veerichetty Feb. 13, 2023, 7:40 p.m. UTC | #1
On Mon, Feb 13, 2023 at 12:37 PM Tomas Henzl <thenzl@redhat.com> wrote:
>
> Write only correct size (32 instead of 64 bytes).
>
> Fixes: 42fc9fee116fc ("scsi: mpi3mr: Add helper functions to manage device's port")
> Signed-off-by: Tomas Henzl <thenzl@redhat.com>
> ---
Acked-by: Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>
>  drivers/scsi/mpi3mr/mpi3mr_transport.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c
> index 3fc897336b5e..3b61815979da 100644
> --- a/drivers/scsi/mpi3mr/mpi3mr_transport.c
> +++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c
> @@ -1280,7 +1280,7 @@ void mpi3mr_sas_host_add(struct mpi3mr_ioc *mrioc)
>
>         if (mrioc->sas_hba.enclosure_handle) {
>                 if (!(mpi3mr_cfg_get_enclosure_pg0(mrioc, &ioc_status,
> -                   &encl_pg0, sizeof(dev_pg0),
> +                   &encl_pg0, sizeof(encl_pg0),
>                     MPI3_ENCLOS_PGAD_FORM_HANDLE,
>                     mrioc->sas_hba.enclosure_handle)) &&
>                     (ioc_status == MPI3_IOCSTATUS_SUCCESS))
> --
> 2.39.1
>
Martin K. Petersen Feb. 22, 2023, 12:50 a.m. UTC | #2
Tomas,

> Write only correct size (32 instead of 64 bytes).

Applied to 6.3/scsi-staging, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c
index 3fc897336b5e..3b61815979da 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_transport.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c
@@ -1280,7 +1280,7 @@  void mpi3mr_sas_host_add(struct mpi3mr_ioc *mrioc)
 
 	if (mrioc->sas_hba.enclosure_handle) {
 		if (!(mpi3mr_cfg_get_enclosure_pg0(mrioc, &ioc_status,
-		    &encl_pg0, sizeof(dev_pg0),
+		    &encl_pg0, sizeof(encl_pg0),
 		    MPI3_ENCLOS_PGAD_FORM_HANDLE,
 		    mrioc->sas_hba.enclosure_handle)) &&
 		    (ioc_status == MPI3_IOCSTATUS_SUCCESS))