iio: accel: hid-sensor-accel-3d: Fix memory leak in probe()

[ Upstream commit b136faff9b ]

'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>
This commit is contained in:
Fabio Estevam 2015-05-13 15:06:09 -03:00 • committed by Sasha Levin
commit e125aa4484