@@ -1604,12 +1604,12 @@ static int cciss_bigpassthru(ctlr_info_t *h, void __user *argp)
status = -EINVAL;
goto free_ioc;
}
- buff_size = kmalloc(MAXSGENTRIES * sizeof(int), GFP_KERNEL);
+ buff_size = kcalloc(MAXSGENTRIES, sizeof(*buff_size), GFP_KERNEL);
if (!buff_size) {
status = -ENOMEM;
goto free_ioc;
}
- buff = kzalloc(MAXSGENTRIES * sizeof(char *), GFP_KERNEL);
+ buff = kcalloc(MAXSGENTRIES, sizeof(*buff), GFP_KERNEL);
if (!buff) {
status = -ENOMEM;
goto free_size;
@@ -4838,8 +4838,9 @@ static int cciss_allocate_scatterlists(ctlr_info_t *h)
int i;
/* zero it, so that on free we need not know how many were alloc'ed */
- h->scatter_list = kzalloc(h->max_commands *
- sizeof(struct scatterlist *), GFP_KERNEL);
+ h->scatter_list = kcalloc(h->max_commands,
+ sizeof(*h->scatter_list),
+ GFP_KERNEL);
if (!h->scatter_list)
return -ENOMEM;