Merge branch 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6...
[firefly-linux-kernel-4.4.55.git] / drivers / base / memory.c
index 7c60ed27e711840108db1767c20e0666d9f9c496..a2e13e250bba2f54eea93e72e9692340d3298d66 100644 (file)
@@ -406,7 +406,9 @@ memory_probe_store(struct device *dev, struct device_attribute *attr,
        int i, ret;
        unsigned long pages_per_block = PAGES_PER_SECTION * sections_per_block;
 
-       phys_addr = simple_strtoull(buf, NULL, 0);
+       ret = kstrtoull(buf, 0, &phys_addr);
+       if (ret)
+               return ret;
 
        if (phys_addr & ((pages_per_block << PAGE_SHIFT) - 1))
                return -EINVAL;