[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101226104905.6801612f@lembas.zaitcev.lan>
Date: Sun, 26 Dec 2010 10:49:05 -0700
From: Pete Zaitcev <zaitcev@...hat.com>
To: Tsozik <tsozik@...oo.com>
Cc: Greg Kroah-Hartman <gregkh@...e.de>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] mct_u232: IOCTL implementation
On Sat, 25 Dec 2010 21:39:39 -0800 (PST)
Tsozik <tsozik@...oo.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists