diff mbox series

[v2,07/15] scsi: qla2xxx: Fix PLOGI payload and ELS IOCB dump length

Message ID 20191120222723.27779-8-r.bolshakov@yadro.com (mailing list archive)
State Changes Requested
Headers show
Series scsi: qla2xxx: Bug fixes | expand

Commit Message

Roman Bolshakov Nov. 20, 2019, 10:27 p.m. UTC
The size of the buffer is hardcoded as 0x70 or 112 bytes, while the
size of ELS IOCB is 0x40 and the size of PLOGI payload returned by
Get Parameters command is 0x74.

Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
 drivers/scsi/qla2xxx/qla_iocb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Himanshu Madhani Nov. 21, 2019, 4:39 p.m. UTC | #1
On 11/20/19, 4:28 PM, "Roman Bolshakov" <r.bolshakov@yadro.com> wrote:

    External Email
    
    ----------------------------------------------------------------------
    The size of the buffer is hardcoded as 0x70 or 112 bytes, while the
    size of ELS IOCB is 0x40 and the size of PLOGI payload returned by
    Get Parameters command is 0x74.
    
    Cc: Quinn Tran <qutran@marvell.com>
    Cc: Himanshu Madhani <hmadhani@marvell.com>
    Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
    ---
     drivers/scsi/qla2xxx/qla_iocb.c | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
    index b25f87ff8cde..bd8160fddcd3 100644
    --- a/drivers/scsi/qla2xxx/qla_iocb.c
    +++ b/drivers/scsi/qla2xxx/qla_iocb.c
    @@ -2676,7 +2676,8 @@ qla24xx_els_logo_iocb(srb_t *sp, struct els_entry_24xx *els_iocb)
     		ql_dbg(ql_dbg_io + ql_dbg_buffer, vha, 0x3073,
     		    "PLOGI ELS IOCB:\n");
     		ql_dump_buffer(ql_log_info, vha, 0x0109,
    -		    (uint8_t *)els_iocb, 0x70);
    +		    (uint8_t *)els_iocb,
    +		    sizeof(*els_iocb));
     	} else {
     		els_iocb->control_flags = 1 << 13;
     		els_iocb->tx_byte_count =
    @@ -2934,7 +2935,8 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,
     
     	ql_dbg(ql_dbg_disc + ql_dbg_buffer, vha, 0x3073, "PLOGI buffer:\n");
     	ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer, vha, 0x0109,
    -	    (uint8_t *)elsio->u.els_plogi.els_plogi_pyld, 0x70);
    +	    (uint8_t *)elsio->u.els_plogi.els_plogi_pyld,
    +	    sizeof(*elsio->u.els_plogi.els_plogi_pyld));
     
     	rval = qla2x00_start_sp(sp);
     	if (rval != QLA_SUCCESS) {
    -- 
    2.24.0
    
    
Looks Good.

Acked-by: Himanshu Madhani <hmadhani@marvell.com>
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index b25f87ff8cde..bd8160fddcd3 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -2676,7 +2676,8 @@  qla24xx_els_logo_iocb(srb_t *sp, struct els_entry_24xx *els_iocb)
 		ql_dbg(ql_dbg_io + ql_dbg_buffer, vha, 0x3073,
 		    "PLOGI ELS IOCB:\n");
 		ql_dump_buffer(ql_log_info, vha, 0x0109,
-		    (uint8_t *)els_iocb, 0x70);
+		    (uint8_t *)els_iocb,
+		    sizeof(*els_iocb));
 	} else {
 		els_iocb->control_flags = 1 << 13;
 		els_iocb->tx_byte_count =
@@ -2934,7 +2935,8 @@  qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,
 
 	ql_dbg(ql_dbg_disc + ql_dbg_buffer, vha, 0x3073, "PLOGI buffer:\n");
 	ql_dump_buffer(ql_dbg_disc + ql_dbg_buffer, vha, 0x0109,
-	    (uint8_t *)elsio->u.els_plogi.els_plogi_pyld, 0x70);
+	    (uint8_t *)elsio->u.els_plogi.els_plogi_pyld,
+	    sizeof(*elsio->u.els_plogi.els_plogi_pyld));
 
 	rval = qla2x00_start_sp(sp);
 	if (rval != QLA_SUCCESS) {