1. 16 Aug, 2012 8 commits
  2. 15 Aug, 2012 1 commit
    • Julia Lawall's avatar
      drivers/tty/moxa.c: fix error return code · 386d95b3
      Julia Lawall authored
      Convert a 0 error return code to a negative one, as returned elsewhere in the
      function.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      identifier ret;
      expression e,e1,e2,e3,e4,x;
      @@
      
      (
      if (\(ret != 0\|ret < 0\) || ...) { ... return ...; }
      |
      ret = 0
      )
      ... when != ret = e1
      *x = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\|ioremap\|ioremap_nocache\|devm_ioremap\|devm_ioremap_nocache\)(...);
      ... when != x = e2
          when != ret = e3
      *if (x == NULL || ...)
      {
        ... when != ret = e4
      *  return ret;
      }
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      386d95b3
  3. 14 Aug, 2012 2 commits
  4. 13 Aug, 2012 25 commits
  5. 10 Aug, 2012 4 commits
    • Jiri Slaby's avatar
      TTY: pass flags to alloc_tty_driver · 7f0bc6a6
      Jiri Slaby authored
      We need to allow drivers that use neither tty_port_install nor
      tty_port_register_device to link a tty_port to a tty somehow.  To
      avoid a race with open, this has to be performed before
      tty_register_device. But currently tty_driver->ports is allocated even
      in tty_register_device because we do not know whether this is the PTY
      driver. The PTY driver is special here due to an excessive count of
      lines it declares to handle. We cannot handle tty_ports there this
      way.
      
      To circumvent this, we start passing tty_driver flags to
      alloc_tty_driver already and we create tty_alloc_driver for this
      purpose. There we can allocate tty_driver->ports and do all the magic
      between tty_alloc_driver and tty_register_device. Later we will
      introduce tty_port_link_device function for that purpose.
      
      All drivers should eventually switch to this new tty driver allocation
      interface.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7f0bc6a6
    • Jiri Slaby's avatar
      TTY: tty3270, free tty driver properly · 2312e4f3
      Jiri Slaby authored
      On module unload, in tty3270_exit, we forgot to free the tty driver.
      Add there a call to put_tty_driver.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: linux390@de.ibm.com
      Cc: linux-s390@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2312e4f3
    • Jiri Slaby's avatar
      TTY: ttyprintk, initialize tty_port earlier · 536a3440
      Jiri Slaby authored
      After tty_register_driver is called, it is too late to initialize a
      guy with which we operate in open. When a process already called
      open(2) on that node, the structures may be in use uninitialized.
      
      Move the initialization prior to tty_register_driver.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Samo Pogacnik <samo_pogacnik@t-2.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      536a3440
    • Jiri Slaby's avatar
      TTY: ttyprintk, don't touch behind tty->write_buf · ee8b593a
      Jiri Slaby authored
      If a user provides a buffer larger than a tty->write_buf chunk and
      passes '\r' at the end of the buffer, we touch an out-of-bound memory.
      
      Add a check there to prevent this.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: stable@vger.kernel.org (everything maintained past v2.6.37)
      Cc: Samo Pogacnik <samo_pogacnik@t-2.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ee8b593a