History

EDAC: Fix kcalloc argument order

First number, then size.

Joe Perches committed 13 years ago

Commit d3d09e11 parent 8024c4c1 file · +3 −3Browse files

Unified · Split

drivers/edac/edac_mc.c+3−3
@@ -340,7 +340,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, · 339 unmodified lines
340340 /*
341341 * Alocate and fill the csrow/channels structs
342342 */
343− mci->csrows = kcalloc(sizeof(*mci->csrows), tot_csrows, GFP_KERNEL);
343+ mci->csrows = kcalloc(tot_csrows, sizeof(*mci->csrows), GFP_KERNEL);
344344 if (!mci->csrows)
345345 goto error;
346346 for (row = 0; row < tot_csrows; row++) {
@@ -351,7 +351,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, · 4 unmodified lines
351351 csr->csrow_idx = row;
352352 csr->mci = mci;
353353 csr->nr_channels = tot_channels;
354− csr->channels = kcalloc(sizeof(*csr->channels), tot_channels,
354+ csr->channels = kcalloc(tot_channels, sizeof(*csr->channels),
355355 GFP_KERNEL);
356356 if (!csr->channels)
357357 goto error;
@@ -369,7 +369,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, · 11 unmodified lines
369369 /*
370370 * Allocate and fill the dimm structs
371371 */
372− mci->dimms = kcalloc(sizeof(*mci->dimms), tot_dimms, GFP_KERNEL);
372+ mci->dimms = kcalloc(tot_dimms, sizeof(*mci->dimms), GFP_KERNEL);
373373 if (!mci->dimms)
374374 goto error;
375375