coresight: tmc: Fix the unbalanced lock in tmc_read()

'commit 734aabed17090: ("coresight: tmc: Fix use after free issue
with tmc read")' adds lock in tmc_read() to fix race condition seen in
reading tmc buffer and enabling the device.But commit has unbalanced
lock. This patch fixes the lock.

Bug: 64453422
Change-Id: Iaf3ecd83ef5af346725885ea2c84c4185f1a1c50
Signed-off-by: Saranya Chidura <schidura@codeaurora.org>
CVE-2017-11033
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
This commit is contained in:
Saranya Chidura 2017-07-26 17:37:17 +05:30 committed by Francescodario Cuzzocrea
parent 5d4b3ae0f6
commit 4006d2ce58
1 changed files with 1 additions and 1 deletions

View File

@ -987,7 +987,7 @@ static ssize_t tmc_read(struct file *file, char __user *data, size_t len,
dev_dbg(drvdata->dev, "%s: %d bytes copied, %d bytes left\n",
__func__, len, (int) (drvdata->size - *ppos));
mutex_lock(&drvdata->usb_lock);
mutex_unlock(&drvdata->usb_lock);
return len;
}