diff mbox series

scsi: lpfc: correct size for cmdwqe/rspwqe for memset

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

Commit Message

Muhammad Usama Anjum March 1, 2024, 2:44 p.m. UTC
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 <usama.anjum@collabora.com>
---
 drivers/scsi/lpfc/lpfc_bsg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Christophe JAILLET March 1, 2024, 4:39 p.m. UTC | #1
Le 01/03/2024 à 15:44, Muhammad Usama Anjum a écrit :
> 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 <usama.anjum@collabora.com>
> ---
>   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..8caf54aa20391 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(union lpfc_wqe128));

Hi,

maybe even:
	memset(cmdwqe, 0, sizeof(*cmdwqe));

Same below and in your other patch.

just my 2c,

CJ


>   	if (phba->sli_rev < LPFC_SLI_REV4) {
>   		rspwqe = &rspiocbq->wqe;
> -		memset(rspwqe, 0, sizeof(union lpfc_wqe));
> +		memset(rspwqe, 0, sizeof(union lpfc_wqe128));
>   	}
>   
>   	INIT_LIST_HEAD(&head);
Justin Tee March 1, 2024, 6:59 p.m. UTC | #2
Hi Muhammad,

Agreed with Christophe's comment.

memset(cmdwqe, 0, sizeof(*cmdwqe));
memset(rspwqe, 0, sizeof(*rspwqe));

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

On 3/1/24 11:59 PM, Justin Tee wrote:
> Hi Muhammad,
> 
> Agreed with Christophe's comment.
> 
> memset(cmdwqe, 0, sizeof(*cmdwqe));
> memset(rspwqe, 0, sizeof(*rspwqe));
> 
> Thanks,
> Justin
>
AngeloGioacchino Del Regno March 4, 2024, 10:18 a.m. UTC | #4
Il 01/03/24 15:44, Muhammad Usama Anjum ha scritto:
> 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 <usama.anjum@collabora.com>
> ---
>   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..8caf54aa20391 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(union lpfc_wqe128));

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

Cheers,
Angelo
diff mbox series

Patch

diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index d80e6e81053b0..8caf54aa20391 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(union lpfc_wqe128));
 	if (phba->sli_rev < LPFC_SLI_REV4) {
 		rspwqe = &rspiocbq->wqe;
-		memset(rspwqe, 0, sizeof(union lpfc_wqe));
+		memset(rspwqe, 0, sizeof(union lpfc_wqe128));
 	}
 
 	INIT_LIST_HEAD(&head);