Skip to contentSkip to conversation

patch "iio: adc: xilinx-ams: fix devm_krealloc() return value check" added to char-misc-linus

PATCH [email protected] 1 participant 1 message Jan 31, 2023

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iio: adc: xilinx-ams: fix devm_krealloc() return value check

to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From 6794ed0cfcc6ce737240eccc48b3e8190df36703 Mon Sep 17 00:00:00 2001
From: Marco Pagani <[email protected]>
Date: Fri, 25 Nov 2022 12:31:12 +0100
Subject: 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.

---
 drivers/iio/adc/xilinx-ams.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/xilinx-ams.c +1 -1
index 5b4bdf3a26bb..a507d2e17079 100644
@@ -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;
Signature · 1 line
2.39.1