Messages in this thread | | | Date | Fri, 22 May 2015 22:09:01 +0900 | From | Sergey Senozhatsky <> | Subject | Re: [PATCH] zram: cut the trailing new-line in algorithm name |
| |
On (05/22/15 18:34), Sergey Senozhatsky wrote: [..] > down_write(&zram->init_lock); > if (init_done(zram)) { > up_write(&zram->init_lock); > @@ -371,6 +378,11 @@ static ssize_t comp_algorithm_store(struct device *dev, > } > strlcpy(zram->compressor, buf, sizeof(zram->compressor)); > up_write(&zram->init_lock); > + > + /* cut the trailing new-line */ > + sz = strlen(zram->compressor) - 1; > + if (zram->compressor[sz] == '\n') > + zram->compressor[sz] = 0x00;
oh, how did it escape from the ->init_lock scope... will resend. sorry.
-ss
| |