1. 15 Nov, 2008 1 commit
    • Julia Lawall's avatar
      ALSA: sound/pci/pcxhr/pcxhr.c: introduce missing kfree and pci_disable_device · d6f35e3f
      Julia Lawall authored
      Error handling code following a kzalloc should free the allocated data.
      The error handling code is adjusted to call pci_disable_device(pci); as
      well, as done later in the function
      
      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 avatarTakashi Iwai <tiwai@suse.de>
      d6f35e3f
  2. 10 Nov, 2008 1 commit
  3. 09 Nov, 2008 2 commits
  4. 07 Nov, 2008 1 commit
  5. 03 Nov, 2008 5 commits
  6. 30 Oct, 2008 3 commits
  7. 29 Oct, 2008 2 commits
  8. 27 Oct, 2008 1 commit
  9. 23 Oct, 2008 1 commit
  10. 22 Oct, 2008 1 commit
  11. 19 Oct, 2008 1 commit
  12. 18 Oct, 2008 1 commit
  13. 16 Oct, 2008 2 commits
  14. 15 Oct, 2008 1 commit
  15. 14 Oct, 2008 1 commit
  16. 13 Oct, 2008 16 commits