Skip to content

Commit 6794ed0

Browse files
Marco Paganijic23
authored andcommitted
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: d5c7062 ("iio: adc: Add Xilinx AMS driver") Signed-off-by: Marco Pagani <[email protected]> Acked-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent cbd3a01 commit 6794ed0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/xilinx-ams.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ static int ams_parse_firmware(struct iio_dev *indio_dev)
13291329

13301330
dev_channels = devm_krealloc(dev, ams_channels, dev_size, GFP_KERNEL);
13311331
if (!dev_channels)
1332-
ret = -ENOMEM;
1332+
return -ENOMEM;
13331333

13341334
indio_dev->channels = dev_channels;
13351335
indio_dev->num_channels = num_channels;

0 commit comments

Comments
 (0)