linux/drivers/iio
Julia Lawall e3db9ef6eb 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>
2012-11-17 10:17:20 +00:00
..
accel staging:iio: Add support for multiple buffers 2012-11-10 10:17:21 +00:00
adc iio:adc:max1363 move from staging. 2012-11-10 10:17:31 +00:00
amplifiers
common iio: hid-sensors: convert HID_SENSOR_ENUM_BASE_QUIRKS to bool 2012-11-17 10:15:41 +00:00
dac iio:dac:ad5449: unlock on error path 2012-10-31 10:59:55 +00:00
frequency iio: frequency: ADF4350: Fix potential reference div factor overflow. 2012-08-16 20:24:33 +01:00
gyro staging:iio: Add support for multiple buffers 2012-11-10 10:17:21 +00:00
light staging:iio: Add support for multiple buffers 2012-11-10 10:17:21 +00:00
magnetometer staging:iio: Add support for multiple buffers 2012-11-10 10:17:21 +00:00
buffer_cb.c staging:iio: add a callback buffer for in kernel push interface 2012-11-10 10:17:27 +00:00
iio_core_trigger.h
iio_core.h
industrialio-buffer.c staging:iio: Add support for multiple buffers 2012-11-10 10:17:21 +00:00
industrialio-core.c staging:iio: Add support for multiple buffers 2012-11-10 10:17:21 +00:00
industrialio-event.c drivers/iio/industrialio-event.c: eliminate possible double free 2012-11-17 10:17:20 +00:00
industrialio-trigger.c iio:trigger: Register sysfs file statically 2012-07-08 10:39:58 +01:00
industrialio-triggered-buffer.c iio: Add helper function for initializing triggered buffers 2012-06-18 17:26:09 -07:00
inkern.c staging:iio:in kernel users: Add a data field for channel specific info. 2012-11-10 10:17:27 +00:00
Kconfig staging:iio: add a callback buffer for in kernel push interface 2012-11-10 10:17:27 +00:00
kfifo_buf.c iio: Drop timestamp parameter from buffer store_to callback 2012-09-08 10:14:34 +01:00
Makefile staging:iio: add a callback buffer for in kernel push interface 2012-11-10 10:17:27 +00:00