From 5554a2a8b182799e38471e9cd7f95aa0d5b2ceab Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 9 Nov 2015 20:08:43 +0000 Subject: [PATCH] qla2x00t: Use kmalloc_array() instead of kmalloc() with multiply git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6635 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla2x00-target/qla2x00t.c | 2 +- qla2x00t/qla_nx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index 07aff2092..dad9e2711 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -4577,7 +4577,7 @@ static int q2t_cut_cmd_data_head(struct q2t_cmd *cmd, unsigned int offset) first_sg, first_page, first_page_offs, cmd->bufflen, cmd->sg_cnt); - sg = kmalloc(cnt * sizeof(sg[0]), GFP_KERNEL); + sg = kmalloc_array(cnt, sizeof(sg[0]), GFP_KERNEL); if (sg == NULL) { PRINT_ERROR("qla2x00t(%ld): Unable to allocate cut " "SG (len %zd)", cmd->tgt->vha->host_no, diff --git a/qla2x00t/qla_nx.c b/qla2x00t/qla_nx.c index f5b5d837e..6978785de 100644 --- a/qla2x00t/qla_nx.c +++ b/qla2x00t/qla_nx.c @@ -1222,7 +1222,7 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha) ql_log(ql_log_info, vha, 0x0072, "%d CRB init values found in ROM.\n", n); - buf = kmalloc(n * sizeof(struct crb_addr_pair), GFP_KERNEL); + buf = kmalloc_array(n, sizeof(struct crb_addr_pair), GFP_KERNEL); if (buf == NULL) { ql_log(ql_log_fatal, vha, 0x010c, "Unable to allocate memory.\n");