public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] eliminate possible double free
@ 2012-10-21 10:52 Julia Lawall
  2012-10-21 10:52 ` [PATCH 1/5] sound/isa/opti9xx/miro.c: " Julia Lawall
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Julia Lawall @ 2012-10-21 10:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

These patches fix cases where a called function frees some data and the
calling context frees the same data.

The complete semantic match is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
parameter list[n] ps;
type T;
identifier a;
expression e;
expression ret != 0;
identifier f,free;
position p1;
@@

f(ps,T a,...) {
  ... when any
      when != a = e
  if(...) { ... free@p1(a); ... return ret; }
  ... when any
}

@s exists@
identifier r.f,r.free;
expression x,a;
position p2,p3;
expression list[r.n] xs;
@@

x = f@p2(xs,a,...);
if (...) { ... free@p3(a); ... return ...; }

@script:python@
p1 << r.p1;
p2 << s.p2;
p3 << s.p3;
@@

cocci.print_main("",p1)
cocci.print_secs("",p2)
cocci.print_secs("",p3)
// </smpl>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-11-16 18:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-21 10:52 [PATCH 0/5] eliminate possible double free Julia Lawall
2012-10-21 10:52 ` [PATCH 1/5] sound/isa/opti9xx/miro.c: " Julia Lawall
2012-10-21 12:18   ` Takashi Iwai
2012-10-21 10:52 ` [PATCH 2/5] drivers/net/wireless/ti/wlcore/main.c: eliminate possible double power off Julia Lawall
2012-11-16 18:18   ` Luciano Coelho
2012-10-21 10:52 ` [PATCH 3/5] arch/powerpc/kernel/rtas_flash.c: eliminate possible double free Julia Lawall
2012-10-21 10:52 ` [PATCH 4/5] ath6kl/wmi.c: " Julia Lawall
2012-11-16 11:17   ` Kalle Valo
2012-10-21 10:52 ` [PATCH 5/5] drivers/iio/industrialio-event.c: " Julia Lawall
2012-11-02  9:39   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox