lkml.org 
[lkml]   [2010]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2010-12-26 18:51    [W:0.041 / U:1.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site