summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNikanth Karthikesan <knikanth@suse.de>2011-03-24 11:46:18 +0530
committerJiri Kosina <jkosina@suse.cz>2011-04-10 17:01:05 +0200
commit9f0af69b2dd34d2c21817d599db7bdb3c972a759 (patch)
tree68f76d50a1dc4d5393175904bb22338c44f012ac /drivers
parent06794eaeb766989e450c1b459ae28da76e1f8719 (diff)
sysfs-memory: fix uninitialized variable warning and clean-up code.
sysfs-memory: Fix uninitialized variable warning and clean-up code. Signed-off-by: Nikanth Karthikesan <knikanth@suse.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/memory.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 3da6a43b775..89ffb4425d1 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -396,15 +396,14 @@ memory_probe_store(struct class *class, struct class_attribute *attr,
ret = add_memory(nid, phys_addr,
PAGES_PER_SECTION << PAGE_SHIFT);
if (ret)
- break;
+ goto out;
phys_addr += MIN_MEMORY_BLOCK_SIZE;
}
- if (ret)
- count = ret;
-
- return count;
+ ret = count;
+out:
+ return ret;
}
static CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store);