]> git.baikalelectronics.ru Git - kernel.git/commit
iio: orientation: hid-sensor-incl-3d: Fix memory leak in probe()
authorFabio Estevam <fabio.estevam@freescale.com>
Wed, 13 May 2015 18:06:12 +0000 (15:06 -0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 17 May 2015 08:10:14 +0000 (09:10 +0100)
commit7f57ccf31ea0051d08400033c6f232c2fa74a16a
tree8455041834371cfe4b963e17b3331f078bcbb896
parentedc3098ed79e3816885ac04e2482bdc0758619b3
iio: orientation: hid-sensor-incl-3d: 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/orientation/hid-sensor-incl-3d.c