Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / drivers / tty / n_hdlc.c
index dabb391909aad63d9152e2cdd5dab35f73d1fe7e..4164414d4c64b266dfce58772241cb009363f4c0 100644 (file)
@@ -573,7 +573,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
                return -EIO;
 
        /* verify user access to buffer */
-       if (!access_ok(VERIFY_WRITE, buf, nr)) {
+       if (!access_ok(buf, nr)) {
                printk(KERN_WARNING "%s(%d) n_hdlc_tty_read() can't verify user "
                "buffer\n", __FILE__, __LINE__);
                return -EFAULT;
@@ -612,7 +612,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
                }
                        
                /* no data */
-               if (file->f_flags & O_NONBLOCK) {
+               if (tty_io_nonblock(tty, file)) {
                        ret = -EAGAIN;
                        break;
                }
@@ -679,7 +679,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
                if (tbuf)
                        break;
 
-               if (file->f_flags & O_NONBLOCK) {
+               if (tty_io_nonblock(tty, file)) {
                        error = -EAGAIN;
                        break;
                }