Skip to content
Snippets Groups Projects
Commit da148fd6 authored by Siena Richard's avatar Siena Richard Committed by Ecco Park
Browse files

ASoC: msm: qdsp6v2: return error when copy from userspace fails


A copy_from_user is not always expected to succeed. Therefore, check
for an error before operating on the buffer post copy.

Bug: 35399404
Change-Id: Ibba9a47c84e735d30e32eeac5b80d51044b7a9e8
CRs-Fixed: 1094852
Signed-off-by: default avatarSiena Richard <sienar@codeaurora.org>
parent 5695f561
Branches
Tags
No related merge requests found
......@@ -819,6 +819,11 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a,
(sizeof(buf_node->frame.frm_hdr) +
sizeof(buf_node->frame.pktlen));
}
if (ret) {
pr_err("%s: copy from user failed %d\n",
__func__, ret);
return -EFAULT;
}
spin_lock_irqsave(&prtd->dsp_lock, dsp_flags);
list_add_tail(&buf_node->list, &prtd->in_queue);
spin_unlock_irqrestore(&prtd->dsp_lock, dsp_flags);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment