All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] [SCSI] bnx2fc: zero out sense buffer properly
@ 2012-08-18  8:46 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2012-08-18  8:46 UTC (permalink / raw)
  To: Bhanu Prakash Gollapudi, FUJITA Tomonori
  Cc: James E.J. Bottomley, linux-scsi, linux-kernel, kernel-janitors

->sense_buffer used to be an array but it changed to pointer in
de25deb180 "[SCSI] use dynamically allocated sense buffer".  This call
to memset() needs to be updated as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 73f231c..8d4626c 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1807,7 +1807,7 @@ static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req,
 			fcp_sns_len = SCSI_SENSE_BUFFERSIZE;
 		}
 
-		memset(sc_cmd->sense_buffer, 0, sizeof(sc_cmd->sense_buffer));
+		memset(sc_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
 		if (fcp_sns_len)
 			memcpy(sc_cmd->sense_buffer, rq_data, fcp_sns_len);
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch] [SCSI] bnx2fc: zero out sense buffer properly
@ 2012-08-18  8:46 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2012-08-18  8:46 UTC (permalink / raw)
  To: Bhanu Prakash Gollapudi, FUJITA Tomonori
  Cc: James E.J. Bottomley, linux-scsi, linux-kernel, kernel-janitors

->sense_buffer used to be an array but it changed to pointer in
de25deb180 "[SCSI] use dynamically allocated sense buffer".  This call
to memset() needs to be updated as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 73f231c..8d4626c 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1807,7 +1807,7 @@ static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req,
 			fcp_sns_len = SCSI_SENSE_BUFFERSIZE;
 		}
 
-		memset(sc_cmd->sense_buffer, 0, sizeof(sc_cmd->sense_buffer));
+		memset(sc_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
 		if (fcp_sns_len)
 			memcpy(sc_cmd->sense_buffer, rq_data, fcp_sns_len);
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] [SCSI] bnx2fc: zero out sense buffer properly
  2012-08-18  8:46 ` Dan Carpenter
@ 2012-08-18  8:53   ` FUJITA Tomonori
  -1 siblings, 0 replies; 4+ messages in thread
From: FUJITA Tomonori @ 2012-08-18  8:53 UTC (permalink / raw)
  To: dan.carpenter
  Cc: bprakash, JBottomley, linux-scsi, linux-kernel, kernel-janitors

On Sat, 18 Aug 2012 11:46:37 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> ->sense_buffer used to be an array but it changed to pointer in
> de25deb180 "[SCSI] use dynamically allocated sense buffer".  This call
> to memset() needs to be updated as well.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
> index 73f231c..8d4626c 100644
> --- a/drivers/scsi/bnx2fc/bnx2fc_io.c
> +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
> @@ -1807,7 +1807,7 @@ static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req,
>  			fcp_sns_len = SCSI_SENSE_BUFFERSIZE;
>  		}
>  
> -		memset(sc_cmd->sense_buffer, 0, sizeof(sc_cmd->sense_buffer));
> +		memset(sc_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);

I guess that you can remove the line instead. IIRC, scsi-ml does it
for LLDs.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] [SCSI] bnx2fc: zero out sense buffer properly
@ 2012-08-18  8:53   ` FUJITA Tomonori
  0 siblings, 0 replies; 4+ messages in thread
From: FUJITA Tomonori @ 2012-08-18  8:53 UTC (permalink / raw)
  To: dan.carpenter
  Cc: bprakash, JBottomley, linux-scsi, linux-kernel, kernel-janitors

On Sat, 18 Aug 2012 11:46:37 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> ->sense_buffer used to be an array but it changed to pointer in
> de25deb180 "[SCSI] use dynamically allocated sense buffer".  This call
> to memset() needs to be updated as well.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
> index 73f231c..8d4626c 100644
> --- a/drivers/scsi/bnx2fc/bnx2fc_io.c
> +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
> @@ -1807,7 +1807,7 @@ static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req,
>  			fcp_sns_len = SCSI_SENSE_BUFFERSIZE;
>  		}
>  
> -		memset(sc_cmd->sense_buffer, 0, sizeof(sc_cmd->sense_buffer));
> +		memset(sc_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);

I guess that you can remove the line instead. IIRC, scsi-ml does it
for LLDs.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-18  8:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-18  8:46 [patch] [SCSI] bnx2fc: zero out sense buffer properly Dan Carpenter
2012-08-18  8:46 ` Dan Carpenter
2012-08-18  8:53 ` FUJITA Tomonori
2012-08-18  8:53   ` FUJITA Tomonori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.