Messages in this thread | | | Date | Sun, 26 Dec 2010 10:49:05 -0700 | From | Pete Zaitcev <> | Subject | Re: [PATCH 1/1] mct_u232: IOCTL implementation |
| |
On Sat, 25 Dec 2010 21:39:39 -0800 (PST) Tsozik <tsozik@yahoo.com> wrote:
> +++ mct_u232.c 2010-12-25 21:44:57.714640343 -0500 > +static int mct_u232_ioctl(struct tty_struct *tty, struct file *file, > + unsigned int cmd, unsigned long arg) > +{ > + case TIOCGICOUNT: > + dbg("%s - (%d) TIOCGICOUNT RX=%d, TX=%d", __func__, > + port->number, mct_u232_port->icount.rx, mct_u232_port->icount.tx); > + if (copy_to_user((void __user *)arg, &mct_u232_port->icount, > + sizeof(mct_u232_port->icount))) > + return -EFAULT;
This looks suspicious. Didn't we relocate the machinery for TIOCGICOUNT into a generic place? Please examine how ->get_icount works before hand-rolling the ioctl.
-- Pete
| |