Re: [PATCH 1/1] mct_u232: IOCTL implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 25 Dec 2010 21:39:39 -0800 (PST)
Tsozik <tsozik@xxxxxxxxx> 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-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux