Commit 350eab50 authored by Cosmin Tanislav's avatar Cosmin Tanislav Committed by Lipeng Sang
Browse files

iio: temperature: ltc2983: allocate iio channels once

stable inclusion
from stable-v5.10.153
commit f19f1a75d378c2d87d98a02e6cb9ffcdc5c9af73
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I64YCA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f19f1a75d378c2d87d98a02e6cb9ffcdc5c9af73



--------------------------------

commit 4132f191 upstream.

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: default avatarCosmin Tanislav <cosmin.tanislav@analog.com>
Fixes: f110f318 ("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: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarLipeng Sang <sanglipeng1@jd.com>
parent 84043826
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment