Skip to contentSkip to conversation

bnx2fc: zero out sense buffer properly

PATCH In review Dan Carpenter 2 participants 2 messages Aug 18, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bnx2fc: zero out sense buffer properly

->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.

drivers/scsi/bnx2fc/bnx2fc_io.c +1 -1
index 73f231c..8d4626c 100644
@@ -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);
 
#1 lore raw
Quoted 11 lines · On Sat, 18 Aug 2012 11:46:37 +0300 Dan Carpenter <[email protected]>…

->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.

drivers/scsi/bnx2fc/bnx2fc_io.c +0 -0
index 73f231c..8d4626c 100644

drivers/scsi/bnx2fc/bnx2fc_io.c static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req, · line 1810

Quoted 5 lines
drivers/scsi/bnx2fc/bnx2fc_io.c +1 -1
@@ -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.