summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/memory.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index dc75de9..62c63c0 100644
--- a/drivers/base/memory.c
+++ b/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;
}
OpenPOWER on IntegriCloud