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  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:   Tue,  8 Jun 2021 17:41:39 +0800
From:   Yang Li <>
        Yang Li <>
Subject: [PATCH] thermal/drivers/tsens: fix usage of unititialized value

When "tsens_version(priv) > VER_0_1" is false,
"regmap_field_read(priv->rf[VER_MINOR], &ver_minor)" can't execute.
So, ver_minor has no initialization and assignment before it is
used, and we initialize it to 0.

Clean up smatch warning:
drivers/thermal/qcom/tsens.c:896 init_common() error: uninitialized
symbol 'ver_minor'.

Reported-by: Abaci Robot <>
Signed-off-by: Yang Li <>
 drivers/thermal/qcom/tsens.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 4c7ebd1..a36c43d 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -743,8 +743,8 @@ int __init init_common(struct tsens_priv *priv)
 	void __iomem *tm_base, *srot_base;
 	struct device *dev = priv->dev;
-	u32 ver_minor;
 	struct resource *res;
+	u32 ver_minor = 0;
 	u32 enabled;
 	int ret, i, j;
 	struct platform_device *op = of_find_device_by_node(priv->dev->of_node);

Powered by blists - more mailing lists