@@ -1345,20 +1345,16 @@ static int seq_ioctl_get_port_info(struct snd_seq_client *client, void *arg)
/*
* SET_PORT_INFO ioctl() (only ports on this/own client)
*/
-static int seq_ioctl_set_port_info(struct snd_seq_client *client,
- void __user *arg)
+static int seq_ioctl_set_port_info(struct snd_seq_client *client, void *arg)
{
+ struct snd_seq_port_info *info = arg;
struct snd_seq_client_port *port;
- struct snd_seq_port_info info;
-
- if (copy_from_user(&info, arg, sizeof(info)))
- return -EFAULT;
- if (info.addr.client != client->number) /* only set our own ports ! */
+ if (info->addr.client != client->number) /* only set our own ports ! */
return -EPERM;
- port = snd_seq_port_use_ptr(client, info.addr.port);
+ port = snd_seq_port_use_ptr(client, info->addr.port);
if (port) {
- snd_seq_set_port_info(port, &info);
+ snd_seq_set_port_info(port, info);
snd_seq_port_unlock(port);
}
return 0;
In former commit, actual operations of each ioctl command get argument in kernel space. Copying from/to user space is performed outside of the function. This commit optimizes to the new design. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> --- sound/core/seq/seq_clientmgr.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)