mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-22 05:01:27 +00:00
scst: Use kcalloc() instead of kzalloc() with multiply
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6625 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -3244,7 +3244,7 @@ int scst_cm_parse_descriptors(struct scst_cmd *ec_cmd)
|
||||
|
||||
TRACE_DBG("tgt_cnt %d", tgt_cnt);
|
||||
|
||||
tgt_descrs = kzalloc(sizeof(*tgt_descrs) * tgt_cnt, GFP_KERNEL);
|
||||
tgt_descrs = kcalloc(tgt_cnt, sizeof(*tgt_descrs), GFP_KERNEL);
|
||||
if (tgt_descrs == NULL) {
|
||||
TRACE(TRACE_OUT_OF_MEM, "Unable to allocate tgt_descrs "
|
||||
"(count %d, size %zd)", tgt_cnt,
|
||||
|
||||
@@ -6121,7 +6121,8 @@ static int scst_ws_sg_tails_get(struct scst_data_descriptor *where, struct scst_
|
||||
while (where[i].sdd_blocks != 0)
|
||||
i++;
|
||||
|
||||
wsp->ws_sg_tails = kzalloc(sizeof(*(wsp->ws_sg_tails))*(i+1), GFP_KERNEL);
|
||||
wsp->ws_sg_tails = kcalloc(i + 1, sizeof(*wsp->ws_sg_tails),
|
||||
GFP_KERNEL);
|
||||
if (wsp->ws_sg_tails == NULL) {
|
||||
PRINT_ERROR("Unable to allocate ws_sg_tails (size %zd)",
|
||||
sizeof(*wsp->ws_sg_tails)*i);
|
||||
@@ -13636,7 +13637,7 @@ static int scst_parse_unmap_descriptors(struct scst_cmd *cmd)
|
||||
if (cnt == 0)
|
||||
goto out_put;
|
||||
|
||||
pd = kzalloc(sizeof(*pd) * cnt, GFP_KERNEL);
|
||||
pd = kcalloc(cnt, sizeof(*pd), GFP_KERNEL);
|
||||
if (pd == NULL) {
|
||||
PRINT_ERROR("Unable to kmalloc UNMAP %d descriptors", cnt+1);
|
||||
scst_set_busy(cmd);
|
||||
|
||||
Reference in New Issue
Block a user