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, 14 Apr 2016 12:40:55 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Lee Jones <lee.jones@...aro.org>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	patches@...nsource.wolfsonmicro.com, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: [patch] mfd: wm8400-core: signedness bug in wm8400_reg_read()

This is harmless because the function is not called, but we're trying to
return negative error codes so the function needs to return an int
instead of a u16.

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

diff --git a/include/linux/mfd/wm8400-private.h b/include/linux/mfd/wm8400-private.h
index 2de565b..53b2021 100644
--- a/include/linux/mfd/wm8400-private.h
+++ b/include/linux/mfd/wm8400-private.h
@@ -923,7 +923,7 @@ struct wm8400 {
 #define WM8400_LINE_CMP_VTHD_SHIFT                   0  /* LINE_CMP_VTHD - [3:0] */
 #define WM8400_LINE_CMP_VTHD_WIDTH                   4  /* LINE_CMP_VTHD - [3:0] */
 
-u16 wm8400_reg_read(struct wm8400 *wm8400, u8 reg);
+int wm8400_reg_read(struct wm8400 *wm8400, u8 reg);
 int wm8400_block_read(struct wm8400 *wm8400, u8 reg, int count, u16 *data);
 
 static inline int wm8400_set_bits(struct wm8400 *wm8400, u8 reg,
diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 3bd44a4..8fe2aa9 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -43,7 +43,7 @@ static bool wm8400_volatile(struct device *dev, unsigned int reg)
  *
  * @return  Read value
  */
-u16 wm8400_reg_read(struct wm8400 *wm8400, u8 reg)
+int wm8400_reg_read(struct wm8400 *wm8400, u8 reg)
 {
 	unsigned int val;
 	int ret;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ