提交 e6028db0 编写于 作者: A Alexey Khoroshilov 提交者: Greg Kroah-Hartman

mei: fix mismatch in mutex unlock-lock in mei_amthif_read()

Users of mei_amthif_read() expect it leaves dev->device_lock held,
while there is a path where mei_amthif_read() unlocks device_lock
and returns -ERESTARTSYS.

The patch move code locking device_lock back before the return.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: NAlexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Acked-by: NTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 d1c3ed66
......@@ -187,13 +187,13 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,
wait_ret = wait_event_interruptible(dev->iamthif_cl.wait,
(cb = mei_amthif_find_read_list_entry(dev, file)));
/* Locking again the Mutex */
mutex_lock(&dev->device_lock);
if (wait_ret)
return -ERESTARTSYS;
dev_dbg(&dev->pdev->dev, "woke up from sleep\n");
/* Locking again the Mutex */
mutex_lock(&dev->device_lock);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册