summaryrefslogtreecommitdiff
path: root/drivers/misc/ntsync.c
diff options
context:
space:
mode:
authorElizabeth Figura <zfigura@codeweavers.com>2024-12-13 13:34:42 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-08 13:18:10 +0100
commitd75abf2f9f2e584633bd1072267a2ff25deb422b (patch)
tree66e2429267fc335ed382f76ed762abc45955a046 /drivers/misc/ntsync.c
parentdef35da76073fcf43c2fae4942ebe55b60dc84a6 (diff)
ntsync: Return the fd from NTSYNC_IOC_CREATE_SEM.
Simplify the user API a bit by returning the fd as return value from the ioctl instead of through the argument pointer. Signed-off-by: Elizabeth Figura <zfigura@codeweavers.com> Link: https://lore.kernel.org/r/20241213193511.457338-2-zfigura@codeweavers.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/ntsync.c')
-rw-r--r--drivers/misc/ntsync.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/misc/ntsync.c b/drivers/misc/ntsync.c
index 4954553b7baa..2e7f698268c1 100644
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -165,7 +165,6 @@ static int ntsync_obj_get_fd(struct ntsync_obj *obj)
static int ntsync_create_sem(struct ntsync_device *dev, void __user *argp)
{
- struct ntsync_sem_args __user *user_args = argp;
struct ntsync_sem_args args;
struct ntsync_obj *sem;
int fd;
@@ -182,12 +181,10 @@ static int ntsync_create_sem(struct ntsync_device *dev, void __user *argp)
sem->u.sem.count = args.count;
sem->u.sem.max = args.max;
fd = ntsync_obj_get_fd(sem);
- if (fd < 0) {
+ if (fd < 0)
kfree(sem);
- return fd;
- }
- return put_user(fd, &user_args->sem);
+ return fd;
}
static int ntsync_char_open(struct inode *inode, struct file *file)