summaryrefslogtreecommitdiff
path: root/drivers/edac/i7core_edac.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-02-04 13:48:54 +0300
committerBorislav Petkov <bp@suse.de>2015-02-23 15:08:45 +0300
commite97d7e38162dc305b4734a316ca758a2bbd1fa6e (patch)
tree47876a2b2e371b28ddcaa6efacaee257c61a3448 /drivers/edac/i7core_edac.c
parente339f1ec979a4ab14b497114e39b8ab70bd0215d (diff)
downloadlinux-e97d7e38162dc305b4734a316ca758a2bbd1fa6e.tar.xz
EDAC: i7core: Return proper error codes for kzalloc() errors
... instead of possibly uninitialized return value. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: http://lkml.kernel.org/r/1423046938-18111-5-git-send-email-tiwai@suse.de [ Add a commit message, albeit a small one. ] Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/edac/i7core_edac.c')
-rw-r--r--drivers/edac/i7core_edac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 9cd0b301f81b..5da90ded54b6 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1177,7 +1177,7 @@ static int i7core_create_sysfs_devices(struct mem_ctl_info *mci)
pvt->addrmatch_dev = kzalloc(sizeof(*pvt->addrmatch_dev), GFP_KERNEL);
if (!pvt->addrmatch_dev)
- return rc;
+ return -ENOMEM;
pvt->addrmatch_dev->type = &addrmatch_type;
pvt->addrmatch_dev->bus = mci->dev.bus;
@@ -1198,7 +1198,7 @@ static int i7core_create_sysfs_devices(struct mem_ctl_info *mci)
if (!pvt->chancounts_dev) {
put_device(pvt->addrmatch_dev);
device_del(pvt->addrmatch_dev);
- return rc;
+ return -ENOMEM;
}
pvt->chancounts_dev->type = &all_channel_counts_type;