[PATCH 315/577] Staging: comedi: range.c: properly mark up __user pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is the start of cleaning up the user pointer markings
in the comedi core.

Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Frank Mori Hess <fmhess@xxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 drivers/staging/comedi/comedi.h              |    2 +-
 drivers/staging/comedi/comedi_compat32.c     |    3 +--
 drivers/staging/comedi/drivers/comedi_bond.c |    4 ++--
 drivers/staging/comedi/internal.h            |    3 ++-
 drivers/staging/comedi/range.c               |    6 ++++--
 5 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index 1251e07..a124ca8 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -368,7 +368,7 @@
 
 	struct comedi_rangeinfo {
 		unsigned int range_type;
-		void *range_ptr;
+		void __user *range_ptr;
 	};
 
 	struct comedi_krange {
diff --git a/drivers/staging/comedi/comedi_compat32.c b/drivers/staging/comedi/comedi_compat32.c
index 581aa5f..41a7a62 100644
--- a/drivers/staging/comedi/comedi_compat32.c
+++ b/drivers/staging/comedi/comedi_compat32.c
@@ -25,9 +25,8 @@
 */
 
 #define __NO_VERSION__
-#include "comedi.h"
 #include <linux/uaccess.h>
-
+#include "comedi.h"
 #include "comedi_compat32.h"
 
 #ifdef CONFIG_COMPAT
diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c
index 22a0f99..7016222 100644
--- a/drivers/staging/comedi/drivers/comedi_bond.c
+++ b/drivers/staging/comedi/drivers/comedi_bond.c
@@ -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
diff --git a/drivers/staging/comedi/internal.h b/drivers/staging/comedi/internal.h
index ce121f2..55b8550 100644
--- a/drivers/staging/comedi/internal.h
+++ b/drivers/staging/comedi/internal.h
@@ -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);
diff --git a/drivers/staging/comedi/range.c b/drivers/staging/comedi/range.c
index 8a1cefd..148ec6f 100644
--- a/drivers/staging/comedi/range.c
+++ b/drivers/staging/comedi/range.c
@@ -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;
-- 
1.7.0.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux