[5.4,123/434] crypto: inside-secure - Fix a maybe-uninitialized warning

Message ID 20191229172709.865939809@linuxfoundation.org
State New
Headers show
  • Untitled series #25985
Related show

Commit Message

Greg KH Dec. 29, 2019, 5:22 p.m.
From: Arnd Bergmann <arnd@arndb.de>

[ Upstream commit 74e6bd472b6d9e80ec9972989d8991736fe46c51 ]

A previous fixup avoided an unused variable warning but replaced
it with a slightly scarier warning:

drivers/crypto/inside-secure/safexcel.c:1100:6: error: variable 'irq' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]

This is harmless as it is impossible to get into this case, but
the compiler has no way of knowing that. Add an explicit error
handling case to make it obvious to both compilers and humans
reading the source.

Fixes: 212ef6f29e5b ("crypto: inside-secure - Fix unused variable warning when CONFIG_PCI=n")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Pascal van Leeuwen <pvanleeuwen@verimatrix.com>

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Signed-off-by: Sasha Levin <sashal@kernel.org>

 drivers/crypto/inside-secure/safexcel.c | 2 ++
 1 file changed, 2 insertions(+)



diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c
index 294debd435b6..991a4425f006 100644
--- a/drivers/crypto/inside-secure/safexcel.c
+++ b/drivers/crypto/inside-secure/safexcel.c
@@ -1120,6 +1120,8 @@  static int safexcel_request_ring_irq(void *pdev, int irqid,
 				irq_name, irq);
 			return irq;
+	} else {
+		return -ENXIO;
 	ret = devm_request_threaded_irq(dev, irq, handler,