diff options
author | Marco Pagani <marpagan@redhat.com> | 2022-11-25 14:31:12 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-12-28 20:20:03 +0300 |
commit | 6794ed0cfcc6ce737240eccc48b3e8190df36703 (patch) | |
tree | a36167c7c8fc3b7e4312e1752e91b1830b38b474 /drivers/iio | |
parent | cbd3a0153cd18a2cbef6bf3cf31bb406c3fc9f55 (diff) | |
download | linux-6794ed0cfcc6ce737240eccc48b3e8190df36703.tar.xz |
iio: adc: xilinx-ams: fix devm_krealloc() return value check
The clang-analyzer reported a warning: "Value stored to 'ret'
is never read".
Fix the return value check if devm_krealloc() fails to resize
ams_channels.
Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver")
Signed-off-by: Marco Pagani <marpagan@redhat.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20221125113112.219290-1-marpagan@redhat.com
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/adc/xilinx-ams.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/xilinx-ams.c b/drivers/iio/adc/xilinx-ams.c index 5b4bdf3a26bb..a507d2e17079 100644 --- a/drivers/iio/adc/xilinx-ams.c +++ b/drivers/iio/adc/xilinx-ams.c @@ -1329,7 +1329,7 @@ static int ams_parse_firmware(struct iio_dev *indio_dev) dev_channels = devm_krealloc(dev, ams_channels, dev_size, GFP_KERNEL); if (!dev_channels) - ret = -ENOMEM; + return -ENOMEM; indio_dev->channels = dev_channels; indio_dev->num_channels = num_channels; |