Commit a56e1600 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'edac_for_3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp

Pull EDAC fixlets from Borislav Petkov:
 "Two minor correctness fixlets from Dan Carpenter and Joe Perches each."

* tag 'edac_for_3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
  EDAC: Fix kcalloc argument order
  EDAC: Test correct variable in ->store function
parents 58ff603b d3d09e18
...@@ -340,7 +340,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, ...@@ -340,7 +340,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
/* /*
* Alocate and fill the csrow/channels structs * Alocate and fill the csrow/channels structs
*/ */
mci->csrows = kcalloc(sizeof(*mci->csrows), tot_csrows, GFP_KERNEL); mci->csrows = kcalloc(tot_csrows, sizeof(*mci->csrows), GFP_KERNEL);
if (!mci->csrows) if (!mci->csrows)
goto error; goto error;
for (row = 0; row < tot_csrows; row++) { for (row = 0; row < tot_csrows; row++) {
...@@ -351,7 +351,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, ...@@ -351,7 +351,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
csr->csrow_idx = row; csr->csrow_idx = row;
csr->mci = mci; csr->mci = mci;
csr->nr_channels = tot_channels; csr->nr_channels = tot_channels;
csr->channels = kcalloc(sizeof(*csr->channels), tot_channels, csr->channels = kcalloc(tot_channels, sizeof(*csr->channels),
GFP_KERNEL); GFP_KERNEL);
if (!csr->channels) if (!csr->channels)
goto error; goto error;
...@@ -369,7 +369,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num, ...@@ -369,7 +369,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
/* /*
* Allocate and fill the dimm structs * Allocate and fill the dimm structs
*/ */
mci->dimms = kcalloc(sizeof(*mci->dimms), tot_dimms, GFP_KERNEL); mci->dimms = kcalloc(tot_dimms, sizeof(*mci->dimms), GFP_KERNEL);
if (!mci->dimms) if (!mci->dimms)
goto error; goto error;
......
...@@ -256,7 +256,7 @@ static ssize_t edac_pci_dev_store(struct kobject *kobj, ...@@ -256,7 +256,7 @@ static ssize_t edac_pci_dev_store(struct kobject *kobj,
struct edac_pci_dev_attribute *edac_pci_dev; struct edac_pci_dev_attribute *edac_pci_dev;
edac_pci_dev = (struct edac_pci_dev_attribute *)attr; edac_pci_dev = (struct edac_pci_dev_attribute *)attr;
if (edac_pci_dev->show) if (edac_pci_dev->store)
return edac_pci_dev->store(edac_pci_dev->value, buffer, count); return edac_pci_dev->store(edac_pci_dev->value, buffer, count);
return -EIO; return -EIO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment