Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
power: msm-core: Fix mutex not getting unlocked in error path
Browse files Browse the repository at this point in the history
When this copy_to_user() fails, the mutex won't be unlocked. Fix it.

Change-Id: I99c93fd04e812d187b83ff375d95a2abba82f501
Signed-off-by: Sultanxda <sultanxda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
  • Loading branch information
kerneltoast authored and ryan-andri committed Oct 11, 2020
1 parent d2434db commit 22d8deb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/qcom/msm-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ static long msm_core_ioctl(struct file *file, unsigned int cmd,
node->sp->voltage,
sizeof(uint32_t) * node->sp->num_of_freqs);
if (ret)
break;
goto unlock;
for (i = 0; i < node->sp->num_of_freqs; i++) {
ret = copy_to_user((void __user *)&argp->freq[i],
&node->sp->table[i].frequency,
Expand Down

0 comments on commit 22d8deb

Please sign in to comment.