diff --git a/drivers/staging/zram/zram_sysfs.c b/drivers/staging/zram/zram_sysfs.c index edb0ed4125d5..de1eacf65dbd 100644 --- a/drivers/staging/zram/zram_sysfs.c +++ b/drivers/staging/zram/zram_sysfs.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "zram_drv.h" @@ -54,13 +55,12 @@ static ssize_t disksize_show(struct device *dev, static ssize_t disksize_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { - int ret; u64 disksize; struct zram *zram = dev_to_zram(dev); - ret = kstrtoull(buf, 10, &disksize); - if (ret) - return ret; + disksize = memparse(buf, NULL); + if (!disksize) + return -EINVAL; down_write(&zram->init_lock); if (zram->init_done) {