iio: light: hid-sensor-als.c: Fix memory leak in probe()
authorFabio Estevam <fabio.estevam@freescale.com>
Wed, 13 May 2015 18:06:11 +0000 (15:06 -0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 17 May 2015 08:10:05 +0000 (09:10 +0100)
commit9ecdbed7903921f29adae63a3155814b453e7186
tree15df9a0a39652d7fd089c5789be00c436cb70606
parentd8c9d23e29e3d758ea477adaa95e28cbf3556518
iio: light: hid-sensor-als.c: Fix memory leak in probe()

'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>
drivers/iio/light/hid-sensor-als.c