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
340 /*340 /*
341 * Alocate and fill the csrow/channels structs341 * Alocate and fill the csrow/channels structs
342 */342 */
343 mci->csrows = kcalloc(sizeof(*mci->csrows), tot_csrows, GFP_KERNEL);343 mci->csrows = kcalloc(tot_csrows, sizeof(*mci->csrows), GFP_KERNEL);
344 if (!mci->csrows)344 if (!mci->csrows)
345 goto error;345 goto error;
346 for (row = 0; row < tot_csrows; row++) {346 for (row = 0; row < tot_csrows; row++) {
@@ -351,7 +351,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, · 4 unmodified lines
351 csr->csrow_idx = row;351 csr->csrow_idx = row;
352 csr->mci = mci;352 csr->mci = mci;
353 csr->nr_channels = tot_channels;353 csr->nr_channels = tot_channels;
354 csr->channels = kcalloc(sizeof(*csr->channels), tot_channels,354 csr->channels = kcalloc(tot_channels, sizeof(*csr->channels),
355 GFP_KERNEL);355 GFP_KERNEL);
356 if (!csr->channels)356 if (!csr->channels)
357 goto error;357 goto error;
@@ -369,7 +369,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, · 11 unmodified lines
369 /*369 /*
370 * Allocate and fill the dimm structs370 * Allocate and fill the dimm structs
371 */371 */
372 mci->dimms = kcalloc(sizeof(*mci->dimms), tot_dimms, GFP_KERNEL);372 mci->dimms = kcalloc(tot_dimms, sizeof(*mci->dimms), GFP_KERNEL);
373 if (!mci->dimms)373 if (!mci->dimms)
374 goto error;374 goto error;
375 375