]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerSasha Levin <sasha.levin@oracle.com>
Thu, 27 Aug 2015 17:26:02 +0000 (13:26 -0400)
commita9ca142ca231614a2af1085c5d09bddffe897a32
tree10101548767a97e0dec66e4b002847f01862f228
parent8d31c41e51ed690755f0f33716e065e960f9949f
iio: light: hid-sensor-als.c: Fix memory leak in probe()

[ Upstream commit 9ecdbed7903921f29adae63a3155814b453e7186 ]

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