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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 19 Apr 2018 13:08:28 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Liam Girdwood <lgirdwood@...il.com>,
        Lee Jones <lee.jones@...aro.org>
Cc:     Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: [PATCH] regulator: ab8500: tidy ab8500_regulator_get_mode()

The indenting here is confusing.

Also we don't check "ret".  That isn't likely to cause a runtime issue
because if it fails here fails then we'd probably return -EINVAL at the
end anyway.  But it does introduce a static checker warning since "val"
is only inititialized on the success path.

    drivers/regulator/ab8500.c:429 ab8500_regulator_get_mode()
    error: uninitialized symbol 'val'.

Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 83dba3fbfe0c..4fab417f1803 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -425,7 +425,10 @@ static unsigned int ab8500_regulator_get_mode(struct regulator_dev *rdev)
 	if (info->mode_mask) {
 		/* Dedicated register for handling mode */
 		ret = abx500_get_register_interruptible(info->dev,
-		info->mode_bank, info->mode_reg, &val);
+							info->mode_bank,
+							info->mode_reg, &val);
+		if (ret)
+			return ret;
 		val = val & info->mode_mask;
 
 		val_normal = info->mode_val_normal;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ