diff mbox series

scsi: lpfc: correct size for wqe for memset

Message ID 20240301144458.2810597-1-usama.anjum@collabora.com (mailing list archive)
State Superseded
Headers show
Series scsi: lpfc: correct size for wqe for memset | expand

Commit Message

Muhammad Usama Anjum March 1, 2024, 2:44 p.m. UTC
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>
---
 drivers/scsi/lpfc/lpfc_nvmet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Justin Tee March 1, 2024, 7:02 p.m. UTC | #1
Hi Muhammad,

> -               memset(wqe, 0, sizeof(union lpfc_wqe));
> +               memset(wqe, 0, sizeof(union lpfc_wqe128));

How about instead memset(wqe, 0, sizeof(*wqe));

Thanks,
Justin
Muhammad Usama Anjum March 4, 2024, 8:45 a.m. UTC | #2
I'll send v2.

On 3/2/24 12:02 AM, Justin Tee wrote:
> Hi Muhammad,
> 
>> -               memset(wqe, 0, sizeof(union lpfc_wqe));
>> +               memset(wqe, 0, sizeof(union lpfc_wqe128));
> 
> How about instead memset(wqe, 0, sizeof(*wqe));
> 
> Thanks,
> Justin
>
AngeloGioacchino Del Regno March 4, 2024, 10:19 a.m. UTC | #3
Il 01/03/24 15:44, 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>
> ---
>   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..29bc6cd10fd69 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(union lpfc_wqe128));

memset(wqe, 0, sizeof(*wqe));

Cheers,
Angelo
diff mbox series

Patch

diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
index 8258b771bd009..29bc6cd10fd69 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(union lpfc_wqe128));
 
 		ctx_buf->iocbq->cmd_dmabuf = NULL;
 		spin_lock(&phba->sli4_hba.sgl_list_lock);