summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2012-10-21 12:52:00 +0200
committerJonathan Cameron <jic23@kernel.org>2012-11-17 11:17:20 +0100
commite3db9ef6eb39ac6d969787bc15756778c2c5ca66 (patch)
treea7252ad7c63ba80a924983bad6b3fd3be3fe6c84 /tools
parentstaging:iio:adt7410: Fix adt7410_set_mode return value (diff)
downloadlinux-e3db9ef6eb39ac6d969787bc15756778c2c5ca66.tar.xz
linux-e3db9ef6eb39ac6d969787bc15756778c2c5ca66.zip
drivers/iio/industrialio-event.c: eliminate possible double free
The function __iio_add_event_config_attrs is only called once, by the function iio_device_register_eventset. If the call fails, iio_device_register_eventset calls __iio_remove_event_config_attrs. There is thus no need for __iio_add_event_config_attrs to also call __iio_remove_event_config_attrs on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ identifier f,free,a; parameter list[n] ps; type T; expression e; @@ f(ps,T a,...) { ... when any when != a = e if(...) { ... free(a); ... return ...; } ... when any } @@ identifier r.f,r.free; expression x,a; expression list[r.n] xs; @@ * x = f(xs,a,...); if (...) { ... free(a); ... return ...; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions