summaryrefslogtreecommitdiffstats
path: root/drivers/staging/gasket/gasket_core.c
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2018-07-19 20:49:17 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-21 08:50:35 +0200
commit761d8db71436d8c67bcac85aa62860cb5848fecf (patch)
tree248c8c29e5bb83864ed5566bfbfccaeee0d2ab13 /drivers/staging/gasket/gasket_core.c
parented74277bd80a47ec552ccf3581583421c3a4df5d (diff)
staging: gasket: top ioctl handler add __user annotations
Add __user annotation to gasket_core top-level ioctl handling pointer arguments, for sparse checking. Reported-by: Dmitry Torokhov <dtor@chromium.org> Signed-off-by: Zhongze Hu <frankhu@chromium.org> Signed-off-by: Todd Poynor <toddpoynor@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gasket/gasket_core.c')
-rw-r--r--drivers/staging/gasket/gasket_core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index 254fb392c05c..40e46ca5228c 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -14,6 +14,7 @@
#include "gasket_page_table.h"
#include "gasket_sysfs.h"
+#include <linux/compiler.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/init.h>
@@ -1781,6 +1782,7 @@ static long gasket_ioctl(struct file *filp, uint cmd, ulong arg)
{
struct gasket_dev *gasket_dev;
const struct gasket_driver_desc *driver_desc;
+ void __user *argp = (void __user *)arg;
char path[256];
if (!filp)
@@ -1810,14 +1812,14 @@ static long gasket_ioctl(struct file *filp, uint cmd, ulong arg)
* check_and_invoke_callback.
*/
if (driver_desc->ioctl_handler_cb)
- return driver_desc->ioctl_handler_cb(filp, cmd, arg);
+ return driver_desc->ioctl_handler_cb(filp, cmd, argp);
gasket_log_error(
gasket_dev, "Received unknown ioctl 0x%x", cmd);
return -EINVAL;
}
- return gasket_handle_ioctl(filp, cmd, arg);
+ return gasket_handle_ioctl(filp, cmd, argp);
}
int gasket_reset(struct gasket_dev *gasket_dev, uint reset_type)