提交 a208ca98 编写于 作者: B Bjorn Andersson 提交者: Andy Gross

soc: qcom: smd: Reject send of too big packets

Attempting to find room for a packet that's bigger than the fifo will
never succeed and the calling process will be sleeping forever in the
loop, waiting for enough room. So fail early instead.
Reported-by: NCourtney Cavin <courtney.cavin@sonymobile.com>
Signed-off-by: NBjorn Andersson <bjorn.andersson@sonymobile.com>
Reviewed-by: NAndy Gross <agross@codeaurora.org>
Signed-off-by: NAndy Gross <agross@codeaurora.org>
上级 24f60e37
......@@ -723,6 +723,10 @@ int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len)
if (channel->info_word && len % 4)
return -EINVAL;
/* Reject packets that are too big */
if (tlen >= channel->fifo_size)
return -EINVAL;
ret = mutex_lock_interruptible(&channel->tx_lock);
if (ret)
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册