Re: serial driver changes

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

 



On Tuesday 08 July 2008, Hinko Kocevar wrote:

Hi Hinko,

>  
> -MODULE_PARM(ussp_debug, "i");
> -MODULE_PARM(ussp_set_lowlatency, "i");
> +//MODULE_PARM(ussp_debug, "i");
> +//MODULE_PARM(ussp_set_lowlatency, "i");
> +/* what is wrong with this lines ??? */
> +//module_parm(ussp_debug, int, 0);
> +//module_parm(ussp_set_lowlatency, int, 0);
>  

Should be module_param(...).


>                 break;
>         case TIOCSSOFTCAR:
> -               if ((rc = verify_area(VERIFY_READ, (void *) arg,
> +               /*  verify_area() function will go away soon - use
> access_ok() instead */ +/*             if ((rc = verify_area(VERIFY_READ,
> (void *) arg,
>                                       sizeof(int))) == 0) {
>                         get_user(ival, (unsigned int *) arg);
>                         tty->termios->c_cflag =
>                                 (tty->termios->c_cflag & ~CLOCAL) |
>                                 (ival ? CLOCAL : 0);
>                 }
> +*/
>                 break;

You can skip the verify_area / access_ok,  just use get_user. BTW, why is this 
section commented.


>                 ussp_dprintk (DEBUG_IOCTL, "USSP_READ %d\n", (int)op.len);
> -               rc = copy_from_user (port->tty->flip.char_buf_ptr, buf +
> sizeof(struct ussp_operation), op.len); -              
> memset(port->tty->flip.flag_buf_ptr, TTY_NORMAL, op.len); -              
> port->tty->flip.count += op.len;
> -               port->tty->flip.char_buf_ptr += op.len;
> -               port->tty->flip.flag_buf_ptr += op.len;
> +               buff = kmalloc((int)op.len, GFP_KERNEL);
> +//             rc = copy_from_user (port->tty->flip.char_buf_ptr, buf +
> sizeof(struct ussp_operation), op.len); +//            
> memset(port->tty->flip.flag_buf_ptr, TTY_NORMAL, op.len); +//            
> port->tty->flip.count += op.len;
> +//             port->tty->flip.char_buf_ptr += op.len;
> +//             port->tty->flip.flag_buf_ptr += op.len;
> +               rc = tty_buffer_request_room(port->tty, (int)op.len);
> +               if (rc > 0)
> +                       tty_insert_flip_string(port->tty, buff,
> (int)op.len); +               tty_insert_flip_char(port->tty, 0,
> TTY_NORMAL);
>                 tty_flip_buffer_push (port->tty);
>                 port->stats.rxcount += op.len;
> +               kfree(buff);
>                 break;

Check the buff usage, it does not seem right to me. But since I don't have any 
context about USSP_READ I can't tell more.


> +/*
> +
>         ussp_dprintk (DEBUG_OPEN, "current->signal->leader: %d
> current->signal->tty: %d tty->session: %d\n", (int)current->signal->leader,
> (int)current->signal->tty, (int)tty->session); if (current->signal->leader
> && !current->signal->tty && tty->session == 0){ ussp_dprintk (DEBUG_OPEN,
> "setting!\n");
> @@ -680,7 +704,7 @@
>                 tty->session = current->signal->session;
>                 tty->pgrp = process_group(current);
>         }
> -
> +*/

I think you can discard this part.


Thanks,
tavi

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux