From 9f0af69b2dd34d2c21817d599db7bdb3c972a759 Mon Sep 17 00:00:00 2001 From: Nikanth Karthikesan Date: Thu, 24 Mar 2011 11:46:18 +0530 Subject: 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 Signed-off-by: Jiri Kosina --- drivers/base/memory.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/base/memory.c') diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 3da6a43b7756..89ffb4425d1d 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); -- cgit v1.2.3