Fix winesync patches (#509)

Fix uninitialized variable
This commit is contained in:
Dmitry Skvortsov
2022-05-04 02:03:21 +03:00
committed by GitHub
parent 08b1f742a4
commit 599eb501b1
10 changed files with 27 additions and 36 deletions

View File

@@ -3716,7 +3716,7 @@ diff --git a/drivers/misc/winesync.c b/drivers/misc/winesync.c
index 27d5baa457df..0f8a8a94eef8 100644
--- a/drivers/misc/winesync.c
+++ b/drivers/misc/winesync.c
@@ -639,6 +639,34 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
@@ -639,6 +639,33 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
return ret;
}
@@ -3726,7 +3726,6 @@ index 27d5baa457df..0f8a8a94eef8 100644
+ struct winesync_event_args args;
+ struct winesync_obj *event;
+ __u32 id;
+ int ret;
+
+ if (get_user(id, &user_args->event))
+ return -EFAULT;
@@ -3745,7 +3744,7 @@ index 27d5baa457df..0f8a8a94eef8 100644
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return ret;
+ return 0;
+}
+
/*

View File

@@ -3716,7 +3716,7 @@ diff --git a/drivers/misc/winesync.c b/drivers/misc/winesync.c
index 27d5baa457df..0f8a8a94eef8 100644
--- a/drivers/misc/winesync.c
+++ b/drivers/misc/winesync.c
@@ -639,6 +639,34 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
@@ -639,6 +639,33 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
return ret;
}
@@ -3726,7 +3726,6 @@ index 27d5baa457df..0f8a8a94eef8 100644
+ struct winesync_event_args args;
+ struct winesync_obj *event;
+ __u32 id;
+ int ret;
+
+ if (get_user(id, &user_args->event))
+ return -EFAULT;
@@ -3745,7 +3744,7 @@ index 27d5baa457df..0f8a8a94eef8 100644
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return ret;
+ return 0;
+}
+
/*

View File

@@ -3716,7 +3716,7 @@ diff --git a/drivers/misc/winesync.c b/drivers/misc/winesync.c
index 27d5baa457df..0f8a8a94eef8 100644
--- a/drivers/misc/winesync.c
+++ b/drivers/misc/winesync.c
@@ -639,6 +639,34 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
@@ -639,6 +639,33 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
return ret;
}
@@ -3726,7 +3726,6 @@ index 27d5baa457df..0f8a8a94eef8 100644
+ struct winesync_event_args args;
+ struct winesync_obj *event;
+ __u32 id;
+ int ret;
+
+ if (get_user(id, &user_args->event))
+ return -EFAULT;
@@ -3745,7 +3744,7 @@ index 27d5baa457df..0f8a8a94eef8 100644
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return ret;
+ return 0;
+}
+
/*

View File

@@ -3716,7 +3716,7 @@ diff --git a/drivers/misc/winesync.c b/drivers/misc/winesync.c
index 27d5baa457df..0f8a8a94eef8 100644
--- a/drivers/misc/winesync.c
+++ b/drivers/misc/winesync.c
@@ -639,6 +639,34 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
@@ -639,6 +639,33 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
return ret;
}
@@ -3726,7 +3726,6 @@ index 27d5baa457df..0f8a8a94eef8 100644
+ struct winesync_event_args args;
+ struct winesync_obj *event;
+ __u32 id;
+ int ret;
+
+ if (get_user(id, &user_args->event))
+ return -EFAULT;
@@ -3745,7 +3744,7 @@ index 27d5baa457df..0f8a8a94eef8 100644
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return ret;
+ return 0;
+}
+
/*

View File

@@ -3716,7 +3716,7 @@ diff --git a/drivers/misc/winesync.c b/drivers/misc/winesync.c
index 27d5baa457df..0f8a8a94eef8 100644
--- a/drivers/misc/winesync.c
+++ b/drivers/misc/winesync.c
@@ -639,6 +639,34 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
@@ -639,6 +639,33 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
return ret;
}
@@ -3726,7 +3726,6 @@ index 27d5baa457df..0f8a8a94eef8 100644
+ struct winesync_event_args args;
+ struct winesync_obj *event;
+ __u32 id;
+ int ret;
+
+ if (get_user(id, &user_args->event))
+ return -EFAULT;
@@ -3745,7 +3744,7 @@ index 27d5baa457df..0f8a8a94eef8 100644
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return ret;
+ return 0;
+}
+
/*

View File

@@ -3717,7 +3717,7 @@ diff --git a/drivers/misc/winesync.c b/drivers/misc/winesync.c
index 27d5baa457df..0f8a8a94eef8 100644
--- a/drivers/misc/winesync.c
+++ b/drivers/misc/winesync.c
@@ -639,6 +639,34 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
@@ -639,6 +639,33 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
return ret;
}
@@ -3727,7 +3727,6 @@ index 27d5baa457df..0f8a8a94eef8 100644
+ struct winesync_event_args args;
+ struct winesync_obj *event;
+ __u32 id;
+ int ret;
+
+ if (get_user(id, &user_args->event))
+ return -EFAULT;
@@ -3746,7 +3745,7 @@ index 27d5baa457df..0f8a8a94eef8 100644
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return ret;
+ return 0;
+}
+
/*

View File

@@ -3717,7 +3717,7 @@ diff --git a/drivers/misc/winesync.c b/drivers/misc/winesync.c
index 27d5baa457df..0f8a8a94eef8 100644
--- a/drivers/misc/winesync.c
+++ b/drivers/misc/winesync.c
@@ -639,6 +639,34 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
@@ -639,6 +639,33 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
return ret;
}
@@ -3727,7 +3727,6 @@ index 27d5baa457df..0f8a8a94eef8 100644
+ struct winesync_event_args args;
+ struct winesync_obj *event;
+ __u32 id;
+ int ret;
+
+ if (get_user(id, &user_args->event))
+ return -EFAULT;
@@ -3746,7 +3745,7 @@ index 27d5baa457df..0f8a8a94eef8 100644
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return ret;
+ return 0;
+}
+
/*

View File

@@ -3717,7 +3717,7 @@ diff --git a/drivers/misc/winesync.c b/drivers/misc/winesync.c
index 27d5baa457df..0f8a8a94eef8 100644
--- a/drivers/misc/winesync.c
+++ b/drivers/misc/winesync.c
@@ -639,6 +639,34 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
@@ -639,6 +639,33 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
return ret;
}
@@ -3727,7 +3727,6 @@ index 27d5baa457df..0f8a8a94eef8 100644
+ struct winesync_event_args args;
+ struct winesync_obj *event;
+ __u32 id;
+ int ret;
+
+ if (get_user(id, &user_args->event))
+ return -EFAULT;
@@ -3746,7 +3745,7 @@ index 27d5baa457df..0f8a8a94eef8 100644
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return ret;
+ return 0;
+}
+
/*

View File

@@ -3718,7 +3718,7 @@ diff --git a/drivers/misc/winesync.c b/drivers/misc/winesync.c
index 27d5baa457df..0f8a8a94eef8 100644
--- a/drivers/misc/winesync.c
+++ b/drivers/misc/winesync.c
@@ -639,6 +639,34 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
@@ -639,6 +639,33 @@ static int winesync_read_mutex(struct winesync_device *dev, void __user *argp)
return ret;
}
@@ -3728,7 +3728,6 @@ index 27d5baa457df..0f8a8a94eef8 100644
+ struct winesync_event_args args;
+ struct winesync_obj *event;
+ __u32 id;
+ int ret;
+
+ if (get_user(id, &user_args->event))
+ return -EFAULT;
@@ -3747,7 +3746,7 @@ index 27d5baa457df..0f8a8a94eef8 100644
+
+ if (copy_to_user(user_args, &args, sizeof(args)))
+ return -EFAULT;
+ return ret;
+ return 0;
+}
+
/*