lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240522095023.35189-1-alisa.roman@analog.com>
Date: Wed, 22 May 2024 12:50:23 +0300
From: Alisa-Dariana Roman <alisadariana@...il.com>
To: andy@...nel.org
Cc: Jonathan.Cameron@...wei.com,
	alisa.roman@...log.com,
	alisadariana@...il.com,
	bigunclemax@...il.com,
	broonie@...nel.org,
	conor+dt@...nel.org,
	devicetree@...r.kernel.org,
	dlechner@...libre.com,
	fr0st61te@...il.com,
	jic23@...nel.org,
	krzysztof.kozlowski+dt@...aro.org,
	lars@...afoo.de,
	lgirdwood@...il.com,
	liambeguin@...il.com,
	linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	marcelo.schmitt@...log.com,
	marcus.folkesson@...il.com,
	michael.hennerich@...log.com,
	nuno.sa@...log.com,
	okan.sahin@...log.com,
	robh@...nel.org,
	schnelle@...ux.ibm.com
Subject: [PATCH] fix

---

Would this fix be alright, since writing something like if(!ret) may be
confusing?

And regarding the comment, my bad, there is nothing wrong there.

 drivers/iio/adc/ad7192.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c
index 101afce49378..0789121236d6 100644
--- a/drivers/iio/adc/ad7192.c
+++ b/drivers/iio/adc/ad7192.c
@@ -1101,14 +1101,12 @@ static int ad7194_parse_channels(struct iio_dev *indio_dev)
 		ret = fwnode_property_read_u32_array(child, "diff-channels",
 						     ain, ARRAY_SIZE(ain));
 		if (ret == 0) {
-			ret = ad7194_validate_ain_channel(dev, ain[0]);
-			if (ret)
+			if (!ad7194_validate_ain_channel(dev, ain[0]))
 				return dev_err_probe(dev, -EINVAL,
 						     "Invalid AIN channel: %u\n",
 						     ain[0]);
 
-			ret = ad7194_validate_ain_channel(dev, ain[1]);
-			if (ret)
+			if (!ad7194_validate_ain_channel(dev, ain[1]))
 				return dev_err_probe(dev, -EINVAL,
 						     "Invalid AIN channel: %u\n",
 						     ain[1]);
@@ -1125,8 +1123,7 @@ static int ad7194_parse_channels(struct iio_dev *indio_dev)
 				return dev_err_probe(dev, ret,
 						     "Missing channel property\n");
 
-			ret = ad7194_validate_ain_channel(dev, ain[0]);
-			if (ret)
+			if (!ad7194_validate_ain_channel(dev, ain[0]))
 				return dev_err_probe(dev, -EINVAL,
 						     "Invalid AIN channel: %u\n",
 						     ain[0]);
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ