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-next>] [day] [month] [year] [list]
Message-Id: <20220319153128.2164120-1-trix@redhat.com>
Date:   Sat, 19 Mar 2022 08:31:28 -0700
From:   trix@...hat.com
To:     mkl@...gutronix.de, mani@...nel.org, thomas.kopp@...rochip.com,
        wg@...ndegger.com, davem@...emloft.net, kuba@...nel.org,
        pabeni@...hat.com, nathan@...nel.org, ndesaulniers@...gle.com
Cc:     linux-can@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
        Tom Rix <trix@...hat.com>
Subject: [PATCH] can: mcp251xfd: return errors from mcp251xfd_register_get_dev_id

From: Tom Rix <trix@...hat.com>

Clang static analysis reports this issue
mcp251xfd-core.c:1813:7: warning: The left operand
  of '&' is a garbage value
  FIELD_GET(MCP251XFD_REG_DEVID_ID_MASK, dev_id),
  ^                                      ~~~~~~

dev_id is set in a successful call to
mcp251xfd_register_get_dev_id().  Though the status
of calls made by mcp251xfd_register_get_dev_id()
are checked and handled, their status' are not
returned.  So return err.

Fixes: 55e5b97f003e ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN")
Signed-off-by: Tom Rix <trix@...hat.com>
---
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 325024be7b045..f9dd8fdba12bc 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -1786,7 +1786,7 @@ mcp251xfd_register_get_dev_id(const struct mcp251xfd_priv *priv, u32 *dev_id,
  out_kfree_buf_rx:
 	kfree(buf_rx);
 
-	return 0;
+	return err;
 }
 
 #define MCP251XFD_QUIRK_ACTIVE(quirk) \
-- 
2.26.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ