memory-hotplug: fix store_mem_state() return value
[cascardo/linux.git] / drivers / base / memory.c
index dc75de9..62c63c0 100644 (file)
@@ -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;
 }