mei: don't update offset in write
authorAlexander Usyskin <alexander.usyskin@intel.com>
Mon, 9 Jul 2018 09:21:44 +0000 (12:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jul 2018 13:44:57 +0000 (15:44 +0200)
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: <stable@vger.kernel.org>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/main.c

index f690918..302ba7a 100644 (file)
@@ -312,7 +312,6 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
                }
        }
 
-       *offset = 0;
        cb = mei_cl_alloc_cb(cl, length, MEI_FOP_WRITE, file);
        if (!cb) {
                rets = -ENOMEM;