aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2011-05-20 14:31:59 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 15:34:24 -0400
commitaeb35ebc5f54bcdd7163f5282a3f39bc48c75cae (patch)
treef60e6cc36643cc7d424d3f7dcc923b7535e36f5a
parentda4b7b2011ecbdc0377b0c0263e85c2d474e3d5a (diff)
[media] imon: Correct call to input_free_device
ictx->touch is intialied in imon_init_intf1, to the result of calling the function that contains this code. Thus, in this code, input_free_device should be called on touch itself. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // <smpl> @r exists@ local idexpression struct input_dev * x; expression ra,rr; position p1,p2; @@ x = input_allocate_device@p1(...) ... when != x = rr when != input_free_device(x,...) when != if (...) { ... input_free_device(x,...) ...} if(...) { ... when != x = ra when forall when != input_free_device(x,...) \(return <+...x...+>; \| return@p2...; \) } @script:python@ p1 << r.p1; p2 << r.p2; @@ cocci.print_main("input_allocate_device",p1) cocci.print_secs("input_free_device",p2) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/rc/imon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index 2d2476d68a1a..3f3c70716268 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -1970,7 +1970,7 @@ static struct input_dev *imon_init_touch(struct imon_context *ictx)
1970 return touch; 1970 return touch;
1971 1971
1972touch_register_failed: 1972touch_register_failed:
1973 input_free_device(ictx->touch); 1973 input_free_device(touch);
1974 1974
1975touch_alloc_failed: 1975touch_alloc_failed:
1976 return NULL; 1976 return NULL;