VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / usb / misc / legousbtower.c
index c44f65a..cd7b548 100644 (file)
@@ -236,8 +236,8 @@ struct lego_usb_tower {
 
 
 /* local function prototypes */
-static ssize_t tower_read      (struct file *file, char *buffer, size_t count, loff_t *ppos);
-static ssize_t tower_write     (struct file *file, const char *buffer, size_t count, loff_t *ppos);
+static ssize_t tower_read      (struct file *file, char __user *buffer, size_t count, loff_t *ppos);
+static ssize_t tower_write     (struct file *file, const char __user *buffer, size_t count, loff_t *ppos);
 static inline void tower_delete (struct lego_usb_tower *dev);
 static int tower_open          (struct inode *inode, struct file *file);
 static int tower_release       (struct inode *inode, struct file *file);
@@ -344,6 +344,7 @@ static int tower_open (struct inode *inode, struct file *file)
 
        dbg(2, "%s: enter", __FUNCTION__);
 
+       nonseekable_open(inode, file);
        subminor = iminor(inode);
 
        down (&disconnect_sem);
@@ -560,7 +561,7 @@ static loff_t tower_llseek (struct file *file, loff_t off, int whence)
 /**
  *     tower_read
  */
-static ssize_t tower_read (struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t tower_read (struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
        struct lego_usb_tower *dev;
        size_t bytes_to_read;
@@ -651,7 +652,7 @@ exit:
 /**
  *     tower_write
  */
-static ssize_t tower_write (struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t tower_write (struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
        struct lego_usb_tower *dev;
        size_t bytes_to_write;