1. 13 Oct, 2008 3 commits
    • Julia Lawall's avatar
      drivers/char/hvc_console.c: adjust call to put_tty_driver · 2571cd6a
      Julia Lawall authored
      The call to put_tty_driver is out of place and is applied to the wrong
      argument.
      
      The function enclosing the patched code calls alloc_tty_driver and stores
      the result in drv.  Subsequently, there are two occurrences of error
      handling code, one making a goto to put_tty and one making a goto to
      stop_thread.  At the point of the first one the assignment hvc_driver = drv
      has not yet been executed, and from inspecting the rest of the file it
      seems that hvc_driver would be NULL.  Thus the current call to
      put_tty_driver is useless, and one applied to drv is needed.  The goto
      stop_thread is in the error handling code for a call to
      tty_register_driver, but the error cases in tty_register_driver do not free
      its argument, so it should be done here.  Thus, I have moved the put_tty
      label after the stop_thread label, so that put_tty_driver is called in both
      cases.
      
      The semantic match that finds this problem is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      expression E,f;
      position p1,p2,p3;
      identifier l;
      statement S;
      @@
      
      x = alloc_tty_driver@p1(...)
      ...
      if (x == NULL) S
      ... when != E = x
          when != put_tty_driver(x)
      goto@p2 l;
      ... when != E = x
          when != f(...,x,...)
          when any
      (
      return \(0\|x\);
      |
      return@p3 ...;
      )
      
      @script:python@
      p1 << r.p1;
      p2 << r.p2;
      p3 << r.p3;
      @@
      
      print "%s: call on line %s not freed or saved before return on line %s via line %s" % (p1[0].file,p1[0].line,p3[0].line,p2[0].line)
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarAlan Cox <alan@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2571cd6a
    • Julia Lawall's avatar
      drivers/serial/crisv10.c: add missing put_tty_driver · 41ca7322
      Julia Lawall authored
      alloc_tty_driver is called at the beginning of the function containing the
      lines of code shown in the patch.  Thus, put_tty_driver is needed before
      returning in the error handling code.
      
      The semantic match that finds this problem is as follows:
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @nr exists@
      local idexpression x;
      expression E,f;
      position p1,p2,p3;
      identifier l;
      statement S;
      @@
      
      x = alloc_tty_driver@p1(...)
      ...
      if (x == NULL) S
      ... when != E = x
          when != put_tty_driver(x)
          when != goto l;
      (
      return \(0\|x\);
      |
      return@p3 ...;
      )
      
      @script:python@
      p1 << nr.p1;
      p3 << nr.p3;
      @@
      
      print "%s: call on line %s not freed or saved before return on line %s" % (p1[0].file,p1[0].line,p3[0].line)
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarAlan Cox <alan@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      41ca7322
    • David Howells's avatar
      MN10300: MEI are renaming themselves to Panasonic · 4fa97181
      David Howells authored
      MEI are renaming themselves to Panasonic, so update the MAINTAINERS
      record for the MN10300 arch.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4fa97181
  2. 12 Oct, 2008 37 commits