mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
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:
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user