提交 6794ed0c 编写于 作者: M Marco Pagani 提交者: Jonathan Cameron

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: d5c70627 ("iio: adc: Add Xilinx AMS driver")
Signed-off-by: NMarco Pagani <marpagan@redhat.com>
Acked-by: NMichal 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: NJonathan Cameron <Jonathan.Cameron@huawei.com>
上级 cbd3a015
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册