Julia Lawall 71b578452e i2c-smbus: Convert kzalloc to devm_kzalloc
Converting kzalloc to devm_kzalloc simplifies the code and ensures that the
result, alert, is freed after the irq allocated by the subsequent
devm_request_irq.  This in turn ensures that when an interrupt can be
triggered, the alert structure is still available.

The problem of a free after a devm_request_irq was found using the
following semantic match (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2,x,a,b,c,d;
identifier free;
position p1,p2;
@@

  devm_request_irq@p1(e1,e2,...,x)
  ... when any
      when != e2 = a
      when != x = b
  if (...) {
    ... when != e2 = c
        when != x = d
    free@p2(...,x,...);
    ...
    return ...;
  }
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-10-05 22:23:52 +02:00
..
2012-10-02 19:01:32 -07:00
2012-10-02 17:26:42 -07:00
2012-10-05 12:01:30 +09:00
2012-10-01 19:11:38 -07:00
2012-09-22 10:29:19 +01:00
2012-10-05 12:01:30 +09:00
2012-09-24 10:07:40 -07:00
2012-10-05 12:01:30 +09:00
2012-10-03 09:44:08 -07:00
2012-10-01 19:11:38 -07:00
2012-10-05 12:01:30 +09:00
2012-10-02 19:01:32 -07:00
2012-10-01 19:11:38 -07:00
2012-10-03 09:44:08 -07:00
2012-10-01 12:09:59 -07:00
2012-10-02 22:09:10 -07:00
2012-10-01 18:46:13 -07:00