public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] ensure arguments to request_irq and free_irq are compatible
@ 2012-03-11 19:36 Julia Lawall
  2012-03-11 19:36 ` [PATCH 1/7] drivers/video/pvr2fb.c: " Julia Lawall
                   ` (6 more replies)
  0 siblings, 7 replies; 26+ messages in thread
From: Julia Lawall @ 2012-03-11 19:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: kernel-janitors

As far as I can see, free_irq does nothing if its second argument is not
the same as the last argument of the corresponding call to request_irq.
These were found using the semantic match below (http://coccinelle.lip6.fr/).
This semantic match finds a number of other cases, but they are mostly in
platform driver probe functions, so the functions should be just converted
to use devm functions, eliminating the need to call free_irq at all.

// <smpl>
@r exists@
expression e,e1,e2,e3,e4,e5;
type T;
position p1,p2;
@@

request_irq@p1(e1,e2,e3,e4,e5)
...
(
 free_irq(e1,(T)e5);
|
free_irq@p2(e1,e);
)

@bad1 exists@
position r.p1,r.p2;
expression e1,e2,e3,e4,e5;
@@

request_irq@p1(e1,e2,e3,e4,(void *)e5)
...
free_irq@p2(e1,e5);

@bad2 exists@
position r.p1,r.p2;
statement S;
@@

if (request_irq@p1(...)) S else { <+... free_irq@p2(...); ...+> }

@script:python depends on !bad1 && !bad2@
p1 << r.p1;
p2 << r.p2;
@@

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


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

end of thread, other threads:[~2012-03-21 18:37 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-11 19:36 [PATCH 0/7] ensure arguments to request_irq and free_irq are compatible Julia Lawall
2012-03-11 19:36 ` [PATCH 1/7] drivers/video/pvr2fb.c: " Julia Lawall
2012-03-21 18:37   ` Florian Tobias Schandinat
2012-03-11 19:36 ` [PATCH 2/7] drivers/scsi/arm/{cumana_2,eesox,powertec}.c: " Julia Lawall
2012-03-11 19:36 ` [PATCH 3/7] drivers/net/irda/{ali-ircc,via-ircc,w83977af-ir}.c: " Julia Lawall
2012-03-11 19:36 ` [PATCH 4/7] arch/sh/drivers/dma/{dma-g2,dmabrg}.c: " Julia Lawall
2012-03-15  6:14   ` Paul Mundt
2012-03-11 19:36 ` [PATCH 5/7] drivers/atm/eni.c: " Julia Lawall
2012-03-11 20:58   ` Chas Williams (CONTRACTOR)
2012-03-11 21:08     ` Julia Lawall
2012-03-11 21:16     ` Julia Lawall
2012-03-11 22:42       ` David Miller
2012-03-11 19:36 ` [PATCH 6/7] drivers/input/touchscreen/hp680_ts_input.c: " Julia Lawall
2012-03-11 23:06   ` Dmitry Torokhov
2012-03-11 19:36 ` [PATCH 7/7] arch/unicore32/kernel/dma.c: " Julia Lawall
2012-03-12  0:58   ` Guan Xuetao
2012-03-12  5:27     ` Julia Lawall
2012-03-13  7:10       ` Guan Xuetao
2012-03-13  8:23         ` Julia Lawall
2012-03-14  8:07           ` Guan Xuetao
2012-03-14  8:19             ` Dan Carpenter
2012-03-14  8:42               ` Guan Xuetao
2012-03-14  9:23                 ` Julia Lawall
2012-03-15  1:01                   ` Guan Xuetao
2012-03-15  6:10                     ` Julia Lawall
2012-03-15  8:07                       ` walter harms

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