Skip to content
Snippets Groups Projects
  1. Jan 07, 2010
  2. Dec 13, 2009
  3. Dec 08, 2009
  4. Dec 04, 2009
  5. Nov 18, 2009
  6. Nov 10, 2009
  7. Oct 29, 2009
  8. Sep 30, 2009
  9. Sep 28, 2009
  10. Sep 22, 2009
  11. Aug 02, 2009
  12. Jul 27, 2009
  13. May 07, 2009
  14. Apr 30, 2009
  15. Apr 13, 2009
  16. Apr 07, 2009
  17. Mar 25, 2009
  18. Mar 21, 2009
  19. Mar 17, 2009
  20. Feb 18, 2009
  21. Feb 10, 2009
  22. Feb 08, 2009
    • Julia Lawall's avatar
      drivers/atm: introduce missing kfree · bc111d57
      Julia Lawall authored
      Error handling code following a kmalloc should free the allocated data.
      
      The semantic match that finds the problem is as follows:
      (http://www.emn.fr/x-info/coccinelle/
      
      )
      
      // <smpl>
      @r exists@
      local idexpression x;
      statement S;
      expression E;
      identifier f,l;
      position p1,p2;
      expression *ptr != NULL;
      @@
      
      (
      if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...)) == NULL) S
      |
      x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      )
      <... when != x
           when != if (...) { <+...x...+> }
      x->f = E
      ...>
      (
       return \(0\|<+...x...+>\|ptr\);
      |
       return@p2 ...;
      )
      
      @script:python@
      p1 << r.p1;
      p2 << r.p2;
      @@
      
      print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
      // </smpl>
      
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bc111d57
  23. Jan 29, 2009
  24. Jan 28, 2009
Loading