From: Alexander Usyskin Date: Mon, 9 Jul 2018 09:21:44 +0000 (+0300) Subject: mei: don't update offset in write X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b653d47ba52d11457397a84c32c3020c32e2c49d;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mei: don't update offset in write commit a103af1b64d74853a5e08ca6c86aeb0e5c6ca4f1 upstream. MEI enables writes of complete messages only while read can be performed in parts, hence write should not update the file offset to not break interleaving partial reads with writes. Cc: Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index 60f5a8ded8dd..8904491dfda4 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c @@ -304,7 +304,6 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, goto out; } - *offset = 0; cb = mei_cl_alloc_cb(cl, length, MEI_FOP_WRITE, file); if (!cb) { rets = -ENOMEM;