projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
zram: check comp algorithm availability earlier
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
block
/
zram
/
zram_drv.c
diff --git
a/drivers/block/zram/zram_drv.c
b/drivers/block/zram/zram_drv.c
index d94696b28a852b8c974cd58a7515b1ad5a1ea051..fb655e8d1e3b17bf4cda9fd09593bc7dc770f78d 100644
(file)
--- a/
drivers/block/zram/zram_drv.c
+++ b/
drivers/block/zram/zram_drv.c
@@
-378,6
+378,9
@@
static ssize_t comp_algorithm_store(struct device *dev,
if (sz > 0 && zram->compressor[sz - 1] == '\n')
zram->compressor[sz - 1] = 0x00;
+ if (!zcomp_available_algorithm(zram->compressor))
+ len = -EINVAL;
+
up_write(&zram->init_lock);
return len;
}