ANDROID: KVM: arm64: Allow single char for hyp tracing interface

Some userspace tools might poke hyp tracing files without a newline
char. Accomodate for them.

Bug: 249050813
Change-Id: I2641080897646dcd299ca491a562b36a7b9b22dc
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
This commit is contained in:
Vincent Donnefort
2023-03-08 18:00:54 +00:00
parent 4a7c893e15
commit 39862f2828
2 changed files with 2 additions and 2 deletions

View File

@@ -128,7 +128,7 @@ hyp_event_write(struct file *filp, const char __user *ubuf, size_t cnt, loff_t *
int ret;
char c;
if (cnt != 2)
if (!cnt || cnt > 2)
return -EINVAL;
if (get_user(c, ubuf))

View File

@@ -306,7 +306,7 @@ hyp_tracing_on(struct file *filp, const char __user *ubuf, size_t cnt, loff_t *p
int err = 0;
char c;
if (cnt != 2)
if (!cnt || cnt > 2)
return -EINVAL;
if (get_user(c, ubuf))