提交 724f4de0 编写于 作者: S shenchenkai

fixed c121d0ee from https://gitee.com/shenchenkai/kernel_liteos_a/pulls/670

Description:[fix] clean hilog/hievent ring buffer after memory verification failed

Change-Id: I9310fe807ec95721be78deb60ed9728ef9b56e48
Signed-off-by: Nshenchenkai <shenchenkai@huawei.com>
上级 744a2db7
......@@ -201,6 +201,13 @@ static ssize_t HiLogRead(struct file *filep, char *buffer, size_t bufLen)
HiLogBufferDec(header.len);
retval = header.len + sizeof(header);
out:
if (retval == -ENOMEM) {
// clean ring buffer
g_hiLogDev.writeOffset = 0;
g_hiLogDev.headOffset = 0;
g_hiLogDev.size = 0;
g_hiLogDev.count = 0;
}
(VOID)LOS_MuxRelease(&g_hiLogDev.mtx);
return retval;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册