scsi: qla2xxx: Use array_size() in vmalloc()
Subsystems (2)
PATCH 1/1 scsi: qla2xxx: Use array_size() in vmalloc()
vmalloc() has no 2-factor argument form, so multiplication factors computing its size need to be wrapped in array_size().
This issue was found with the help of Coccinelle and audited and fixed manually.
Addresses-KSPP-ID: https://github.com/KSPP/linux/issues/83
Signed-off-by Michael Estner <[email protected]>
--- drivers/scsi/qla2xxx/qla_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_init.c +1 -1
@@ -8652,7 +8652,7 @@ qla28xx_load_fw_template(scsi_qla_host_t *vha, uint32_t faddr)ql_dbg (ql_dbg_init, vha,0x01a5 ,"-> fwdt%u template allocate template %#x words...\n" , j, risc_size); - fwdt->template =vmalloc (risc_size *sizeof (*dcode)); + fwdt->template =vmalloc (array_size (risc_size,sizeof (*dcode)));if (!fwdt->template) {ql_log (ql_log_warn, vha,0x01a6 ,"-> fwdt%u failed allocate template.\n" , j);
Signature · 1 line
2.34.1