Staging: comedi: range.c: properly mark up __user pointers
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 3 May 2010 22:50:09 +0000 (15:50 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:36:03 +0000 (11:36 -0700)
This is the start of cleaning up the user pointer markings
in the comedi core.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/comedi.h
drivers/staging/comedi/comedi_compat32.c
drivers/staging/comedi/drivers/comedi_bond.c
drivers/staging/comedi/internal.h
drivers/staging/comedi/range.c

index 1251e074cb2bec57cd34901b2d733598980b55b2..a124ca8d03654309600d2f53271b847f5db77557 100644 (file)
 
        struct comedi_rangeinfo {
                unsigned int range_type;
-               void *range_ptr;
+               void __user *range_ptr;
        };
 
        struct comedi_krange {
index 581aa5fee2e3ac3b1b090b6d0da5fcaf3214394b..41a7a62ba49a5958c044206822b644a4c06d4876 100644 (file)
@@ -25,9 +25,8 @@
 */
 
 #define __NO_VERSION__
-#include "comedi.h"
 #include <linux/uaccess.h>
-
+#include "comedi.h"
 #include "comedi_compat32.h"
 
 #ifdef CONFIG_COMPAT
index 22a0f996eeb088a844a359752c7a08dc506611f3..701622280ff475d1e13c409d54e45b3f13ddc970 100644 (file)
@@ -87,11 +87,11 @@ Configuration Options:
  * options that are used with comedi_config.
  */
 
+#include <linux/string.h>
+#include <linux/slab.h>
 #include "../comedi.h"
 #include "../comedilib.h"
 #include "../comedidev.h"
-#include <linux/string.h>
-#include <linux/slab.h>
 
 /* The maxiumum number of channels per subdevice. */
 #define MAX_CHANS 256
index ce121f21ebc5b718f7dbbbe2b72bb0b21b7a9422..55b85501c92c53e7993a0f124c19156d8985ec83 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * various internal comedi functions
  */
-int do_rangeinfo_ioctl(struct comedi_device *dev, struct comedi_rangeinfo *arg);
+int do_rangeinfo_ioctl(struct comedi_device *dev,
+                      struct comedi_rangeinfo __user *arg);
 int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
               struct comedi_insn *insn, unsigned int *data);
 int comedi_alloc_board_minor(struct device *hardware_device);
index 8a1cefd97fdbfa78f02863253d377583b86b3110..148ec6fd6fdde20b70cb27d50dd104b261fc22d7 100644 (file)
@@ -21,8 +21,9 @@
 
 */
 
-#include "comedidev.h"
 #include <linux/uaccess.h>
+#include "comedidev.h"
+#include "internal.h"
 
 const struct comedi_lrange range_bipolar10 = { 1, {BIP_RANGE(10)} };
 EXPORT_SYMBOL(range_bipolar10);
@@ -50,7 +51,8 @@ EXPORT_SYMBOL(range_unknown);
        writes:
                n struct comedi_krange structures to rangeinfo->range_ptr
 */
-int do_rangeinfo_ioctl(struct comedi_device *dev, struct comedi_rangeinfo *arg)
+int do_rangeinfo_ioctl(struct comedi_device *dev,
+                      struct comedi_rangeinfo __user *arg)
 {
        struct comedi_rangeinfo it;
        int subd, chan;