Skip to contentSkip to conversation

virt: acrn: Correct type casting of argument of copy_from_user()

PATCH New [email protected] 1 participant 1 message Mar 10, 2021 Acrn hypervisor service module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virt: acrn: Correct type casting of argument of copy_from_user()

From: Shuo Liu <[email protected]>

hsm.c:336:50: warning: incorrect type in argument 2 (different address spaces)
hsm.c:336:50: expected void const [noderef] __user *from
hsm.c:336:50: got void *

This patch fixes above sparse warning.

Fixes 3d679d5aec64 ("virt: acrn: Introduce interfaces to query C-states and P-states allowed by hypervisor")
---
 drivers/virt/acrn/hsm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/virt/acrn/hsm.c +1 -1
index 1f6b7c54a1a4..37cc7acd7df8 100644
@@ -333,7 +333,7 @@ static long acrn_dev_ioctl(struct file *filp, unsigned int cmd,
 		acrn_ioreq_request_clear(vm);
 		break;
 	case ACRN_IOCTL_PM_GET_CPU_STATE:
-		if (copy_from_user(&cstate_cmd, (void *)ioctl_param,
+		if (copy_from_user(&cstate_cmd, (void __user *)ioctl_param,
 				   sizeof(cstate_cmd)))
 			return -EFAULT;
 
Signature · 1 line
2.28.0