]> git.baikalelectronics.ru Git - kernel.git/commit
iio: temperature: ltc2983: allocate iio channels once
authorCosmin Tanislav <cosmin.tanislav@analog.com>
Fri, 14 Oct 2022 12:37:22 +0000 (15:37 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 Oct 2022 07:51:26 +0000 (08:51 +0100)
commit7a0eaac8c586f7f8812bfb8350e777bf7219e6bf
tree44e35e3a676e72f5cb40eee2c86ed5d93e924497
parentaad67635441efc3fab91655922a7d3333c58d417
iio: temperature: ltc2983: allocate iio channels once

Currently, every time the device wakes up from sleep, the
iio_chan array is reallocated, leaking the previous one
until the device is removed (basically never).

Move the allocation to the probe function to avoid this.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Fixes: 46aa8b98ce3d9 ("iio: temperature: Add support for LTC2983")
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20221014123724.1401011-2-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/temperature/ltc2983.c