From 52c563d3928077c7e50fd121162709facf20214b Mon Sep 17 00:00:00 2001 From: Mikael Olsson Date: Thu, 24 Aug 2023 13:28:35 +0200 Subject: Remove copy from user in network info IOCTL call The network info IOCTL call doesn't use any information from the user provided struct so there is no need to copy the struct to kernel space. Change-Id: I3f58a80ab9377e4ae39fc29068de6fd6bc3d539c Signed-off-by: Mikael Olsson --- kernel/ethosu_network.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/kernel/ethosu_network.c b/kernel/ethosu_network.c index 6dc0ce4..71ae484 100644 --- a/kernel/ethosu_network.c +++ b/kernel/ethosu_network.c @@ -113,18 +113,10 @@ static long ethosu_network_ioctl(struct file *file, case ETHOSU_IOCTL_NETWORK_INFO: { struct ethosu_uapi_network_info uapi; - if (copy_from_user(&uapi, udata, sizeof(uapi))) { - ret = -EFAULT; - break; - } - - dev_info(dev, - "Network ioctl: Network info. net=0x%pK\n", - net); + dev_info(dev, "Network ioctl: Network info. net=0x%pK\n", net); - ret = - ethosu_network_info_request(dev, net->mailbox, net, - &uapi); + ret = ethosu_network_info_request(dev, net->mailbox, net, + &uapi); if (ret) break; -- cgit v1.2.1