]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: accel: hid-sensor-accel-3d: Fix memory leak in probe()
authorFabio Estevam <fabio.estevam@freescale.com>
Wed, 13 May 2015 18:06:09 +0000 (15:06 -0300)
committerSasha Levin <sasha.levin@oracle.com>
Thu, 27 Aug 2015 17:26:03 +0000 (13:26 -0400)
commite125aa4484322bec7ff15a8defa3233e27f12f93
tree2394d85af542715d937625b41b974d0b91a22e50
parent1ca8e343d2afd47e4f157f32987883765cb22217
iio: accel: hid-sensor-accel-3d: Fix memory leak in probe()

[ Upstream commit b136faff9bc2f4adea050ed2119c01199f9a86a5 ]

'channels' is allocated via kmemdup and it is never freed in the
subsequent error paths.

Use 'indio_dev->channels' directly instead, so that we avoid such
memory leak problem.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/iio/accel/hid-sensor-accel-3d.c