[PATCH v2] scsi: lpfc: correct size for wqe for memset

Muhammad Usama Anjum posted 1 patch 1 year, 11 months ago
drivers/scsi/lpfc/lpfc_nvmet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] scsi: lpfc: correct size for wqe for memset
Posted by Muhammad Usama Anjum 1 year, 11 months ago
The wqe is of type lpfc_wqe128. It should be memset with the same type.

Fixes: 6c621a2229b0 ("scsi: lpfc: Separate NVMET RQ buffer posting from IO resources SGL/iocbq/context")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
Changes since v1:
- Use *wqe instead of type to find sizeof
---
 drivers/scsi/lpfc/lpfc_nvmet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
index 8258b771bd009..561ced5503c63 100644
--- a/drivers/scsi/lpfc/lpfc_nvmet.c
+++ b/drivers/scsi/lpfc/lpfc_nvmet.c
@@ -1586,7 +1586,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba)
 		wqe = &nvmewqe->wqe;
 
 		/* Initialize WQE */
-		memset(wqe, 0, sizeof(union lpfc_wqe));
+		memset(wqe, 0, sizeof(*wqe));
 
 		ctx_buf->iocbq->cmd_dmabuf = NULL;
 		spin_lock(&phba->sli4_hba.sgl_list_lock);
-- 
2.39.2
Re: [PATCH v2] scsi: lpfc: correct size for wqe for memset
Posted by Martin K. Petersen 1 year, 11 months ago
Muhammad,

> The wqe is of type lpfc_wqe128. It should be memset with the same
> type.

Applied to 6.9/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering
Re: [PATCH v2] scsi: lpfc: correct size for wqe for memset
Posted by Justin Tee 1 year, 11 months ago
> The wqe is of type lpfc_wqe128. It should be memset with the same type.
>
> Fixes: 6c621a2229b0 ("scsi: lpfc: Separate NVMET RQ buffer posting from IO resources SGL/iocbq/context")
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
> Changes since v1:
> - Use *wqe instead of type to find sizeof
> ---
>  drivers/scsi/lpfc/lpfc_nvmet.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
> index 8258b771bd009..561ced5503c63 100644
> --- a/drivers/scsi/lpfc/lpfc_nvmet.c
> +++ b/drivers/scsi/lpfc/lpfc_nvmet.c
> @@ -1586,7 +1586,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba)
>                 wqe = &nvmewqe->wqe;
>
>                 /* Initialize WQE */
> -               memset(wqe, 0, sizeof(union lpfc_wqe));
> +               memset(wqe, 0, sizeof(*wqe));
>
>                 ctx_buf->iocbq->cmd_dmabuf = NULL;
>                 spin_lock(&phba->sli4_hba.sgl_list_lock);
> --
> 2.39.2

Reviewed-by: Justin Tee <justintee8345@gmail.com>
Re: [PATCH v2] scsi: lpfc: correct size for wqe for memset
Posted by AngeloGioacchino Del Regno 1 year, 11 months ago
Il 04/03/24 10:06, Muhammad Usama Anjum ha scritto:
> The wqe is of type lpfc_wqe128. It should be memset with the same type.
> 
> Fixes: 6c621a2229b0 ("scsi: lpfc: Separate NVMET RQ buffer posting from IO resources SGL/iocbq/context")
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>