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