1. 19 8月, 2011 1 次提交
    • J
      drivers/ata/sata_dwc_460ex.c: add missing kfree · a081da63
      Julia Lawall 提交于
      Currently, error handling code in this function calls the function
      sata_dwc_port_stop, but this function has essentially no effect if hsdevp
      has not been stored in ap, which is the case throughout this function.  The
      only effect is to print a debugging message including ap->print_id.
      
      The code is rewritten to not call sata_dwc_port_stop, but instead to jump
      to a local label that prints the original error message and the print_id
      information.  In the case where hsdevp has been already allocated (but not
      yet stored in ap), this value is freed as well.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @exists@
      local idexpression x;
      statement S,S1;
      expression E;
      identifier fl;
      expression *ptr != NULL;
      @@
      
      x = \(kmalloc\|kzalloc\|kcalloc\)(...);
      ...
      if (x == NULL) S
      <... when != x
           when != if (...) { <+...kfree(x)...+> }
           when any
           when != true x == NULL
      x->fl
      ...>
      (
      if (x == NULL) S1
      |
      if (...) { ... when != x
                     when forall
      (
       return \(0\|<+...x...+>\|ptr\);
      |
      * return ...;
      )
      }
      )
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
      a081da63
  2. 26 7月, 2011 1 次提交
  3. 24 7月, 2011 1 次提交
  4. 27 6月, 2011 1 次提交
  5. 24 6月, 2011 1 次提交
  6. 02 3月, 2011 6 次提交
  7. 01 3月, 2011 1 次提交
  8. 26 8月, 2010 1 次提交
  9. 17 8月, 2010 1 次提交
  10. 02 8月, 2010 1 次提交