2024-03-04 09:11:18

by Muhammad Usama Anjum

[permalink] [raw]
Subject: [PATCH v2] scsi: lpfc: correct size for cmdwqe/rspwqe for memset

The cmdwqe and rspwqe are of type lpfc_wqe128. They should be memset
with the same type.

Fixes: 61910d6a5243 ("scsi: lpfc: SLI path split: Refactor CT paths")
Signed-off-by: Muhammad Usama Anjum <[email protected]>
---
Changes since v1:
- Use *ptr instead of specifying type in sizeof
---
drivers/scsi/lpfc/lpfc_bsg.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index d80e6e81053b0..7d5275d3a7406 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -3169,10 +3169,10 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job)
}

cmdwqe = &cmdiocbq->wqe;
- memset(cmdwqe, 0, sizeof(union lpfc_wqe));
+ memset(cmdwqe, 0, sizeof(*cmdwqe));
if (phba->sli_rev < LPFC_SLI_REV4) {
rspwqe = &rspiocbq->wqe;
- memset(rspwqe, 0, sizeof(union lpfc_wqe));
+ memset(rspwqe, 0, sizeof(*rspwqe));
}

INIT_LIST_HEAD(&head);
--
2.39.2



2024-03-04 18:26:24

by Justin Tee

[permalink] [raw]
Subject: Re: [PATCH v2] scsi: lpfc: correct size for cmdwqe/rspwqe for memset

> The cmdwqe and rspwqe are of type lpfc_wqe128. They should be memset
> with the same type.
>
> Fixes: 61910d6a5243 ("scsi: lpfc: SLI path split: Refactor CT paths")
> Signed-off-by: Muhammad Usama Anjum <[email protected]>
> ---
> Changes since v1:
> - Use *ptr instead of specifying type in sizeof
> ---
> drivers/scsi/lpfc/lpfc_bsg.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
> index d80e6e81053b0..7d5275d3a7406 100644
> --- a/drivers/scsi/lpfc/lpfc_bsg.c
> +++ b/drivers/scsi/lpfc/lpfc_bsg.c
> @@ -3169,10 +3169,10 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job)
> }
>
> cmdwqe = &cmdiocbq->wqe;
> - memset(cmdwqe, 0, sizeof(union lpfc_wqe));
> + memset(cmdwqe, 0, sizeof(*cmdwqe));
> if (phba->sli_rev < LPFC_SLI_REV4) {
> rspwqe = &rspiocbq->wqe;
> - memset(rspwqe, 0, sizeof(union lpfc_wqe));
> + memset(rspwqe, 0, sizeof(*rspwqe));
> }
>
> INIT_LIST_HEAD(&head);
> --
> 2.39.2
>

Reviewed-by: Justin Tee <[email protected]>

--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.


Attachments:
smime.p7s (4.10 kB)
S/MIME Cryptographic Signature

2024-03-10 22:18:59

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH v2] scsi: lpfc: correct size for cmdwqe/rspwqe for memset


Muhammad,

> The cmdwqe and rspwqe are of type lpfc_wqe128. They should be memset
> with the same type.

Applied to 6.9/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering