Skip to contentSkip to conversation

memory-hotplug-fix-store_mem_state-return-value.patch removed from -mm tree

merged [email protected] 1 participant 1 message Oct 10, 2016

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: memory-hotplug: fix store_mem_state() return value
has been removed from the -mm tree. Its filename was
memory-hotplug-fix-store_mem_state-return-value.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Reza Arbab <[email protected]>
Subject: memory-hotplug: fix store_mem_state() return value

If store_mem_state() is called to online memory which is already online, it will return 1, the value it got from device_online().

This is wrong because store_mem_state() is a device_attribute .store function. Thus a non-negative return value represents input bytes read.

Set the return value to -EINVAL in this case.

Cc Greg Kroah-Hartman <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Vitaly Kuznetsov <[email protected]>
Cc David Rientjes <[email protected]>
Cc Yaowei Bai <[email protected]>
Cc Joonsoo Kim <[email protected]>
Cc Dan Williams <[email protected]>
Cc Xishi Qiu <[email protected]>
Cc David Vrabel <[email protected]>
Cc Chen Yucong <[email protected]>
Cc Andrew Banman <[email protected]>
Cc Seth Jennings <[email protected]>

---

 drivers/base/memory.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/base/memory.c renamed from drivers/base/memory.c~memory-hotplug-fix-store_mem_state-return-value +4 -1
diff -puN drivers/base/memory.c~memory-hotplug-fix-store_mem_state-return-value drivers/base/memory.c
@@ -361,8 +361,11 @@ store_mem_state(struct device *dev,
 err:
 	unlock_device_hotplug();
 
-	if (ret)
+	if (ret < 0)
 		return ret;
+	if (ret)
+		return -EINVAL;
+
 	return count;
 }
 

_

Patches currently in -mm which might be from [email protected] are