From 0c53eca08926955c607ec657795e9352bfa69757 Mon Sep 17 00:00:00 2001 From: hw_llm Date: Wed, 21 Aug 2024 20:57:40 +0800 Subject: [PATCH] =?UTF-8?q?cherry=20pick=20b22a7c2=20from=20https://gitee.?= =?UTF-8?q?com/hw=5Fllm/kernel=5Fliteos=5Fa/pulls/1212=20Description:=20co?= =?UTF-8?q?nsole=20read=20=E6=BC=8F=E6=B4=9E=E4=BF=AE=E5=A4=8D=20IssueNo:?= =?UTF-8?q?=20https://gitee.com/openharmony/kernel=5Fliteos=5Fa/issues/IAL?= =?UTF-8?q?LNX=3Ffrom=3Dproject-issue=20Feature=20Or=20Bugfix:=20Feature?= =?UTF-8?q?=20Binary=20Source:=20No=20Signed-off-by:=20hw=5Fllm=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/common/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/common/console.c b/kernel/common/console.c index bfaa4c59..624a0775 100644 --- a/kernel/common/console.c +++ b/kernel/common/console.c @@ -687,7 +687,7 @@ STATIC ssize_t ConsoleRead(struct file *filep, CHAR *buffer, size_t bufLen) } if (userBuf) { - if (LOS_ArchCopyToUser(buffer, sbuffer, bufLen) != 0) { + if (LOS_ArchCopyToUser(buffer, sbuffer, ret) != 0) { ret = -EFAULT; goto ERROUT; }