Commit d9ab5f1f authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: qla2xxx: Increase the size of struct qla_fcp_prio_cfg to FCP_PRIO_CFG_SIZE

This patch fixes the following Coverity complaint without changing any
functionality:

CID 337793 (#1 of 1): Wrong size argument (SIZEOF_MISMATCH)
suspicious_sizeof: Passing argument ha->fcp_prio_cfg of type
struct qla_fcp_prio_cfg * and argument 32768UL to function memset is
suspicious because a multiple of sizeof (struct qla_fcp_prio_cfg) /*48*/
is expected.

memset(ha->fcp_prio_cfg, 0, FCP_PRIO_CFG_SIZE);

Link: https://lore.kernel.org/r/20200518211712.11395-8-bvanassche@acm.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: default avatarDaniel Wagner <dwagner@suse.de>
Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 66f86367
...@@ -2217,8 +2217,9 @@ struct qla_fcp_prio_cfg { ...@@ -2217,8 +2217,9 @@ struct qla_fcp_prio_cfg {
#define FCP_PRIO_ATTR_PERSIST 0x2 #define FCP_PRIO_ATTR_PERSIST 0x2
uint8_t reserved; /* Reserved for future use */ uint8_t reserved; /* Reserved for future use */
#define FCP_PRIO_CFG_HDR_SIZE 0x10 #define FCP_PRIO_CFG_HDR_SIZE 0x10
struct qla_fcp_prio_entry entry[1]; /* fcp priority entries */ struct qla_fcp_prio_entry entry[1023]; /* fcp priority entries */
#define FCP_PRIO_CFG_ENTRY_SIZE 0x20 #define FCP_PRIO_CFG_ENTRY_SIZE 0x20
uint8_t reserved2[16];
}; };
#define FCP_PRIO_CFG_SIZE (32*1024) /* fcp prio data per port*/ #define FCP_PRIO_CFG_SIZE (32*1024) /* fcp prio data per port*/
......
...@@ -7883,6 +7883,7 @@ qla2x00_module_init(void) ...@@ -7883,6 +7883,7 @@ qla2x00_module_init(void)
BUILD_BUG_ON(sizeof(struct qla82xx_uri_data_desc) != 28); BUILD_BUG_ON(sizeof(struct qla82xx_uri_data_desc) != 28);
BUILD_BUG_ON(sizeof(struct qla82xx_uri_table_desc) != 32); BUILD_BUG_ON(sizeof(struct qla82xx_uri_table_desc) != 32);
BUILD_BUG_ON(sizeof(struct qla83xx_fw_dump) != 51196); BUILD_BUG_ON(sizeof(struct qla83xx_fw_dump) != 51196);
BUILD_BUG_ON(sizeof(struct qla_fcp_prio_cfg) != FCP_PRIO_CFG_SIZE);
BUILD_BUG_ON(sizeof(struct qla_fdt_layout) != 128); BUILD_BUG_ON(sizeof(struct qla_fdt_layout) != 128);
BUILD_BUG_ON(sizeof(struct qla_flt_header) != 8); BUILD_BUG_ON(sizeof(struct qla_flt_header) != 8);
BUILD_BUG_ON(sizeof(struct qla_flt_region) != 16); BUILD_BUG_ON(sizeof(struct qla_flt_region) != 16);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment