Netdev List
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-can@vger.kernel.org,
	kernel@pengutronix.de, "Ira W. Snyder" <iws@ovro.caltech.edu>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 3/3] can: janz-ican3: fix uninitialized variable warnings
Date: Wed, 29 Jan 2014 22:11:03 +0100	[thread overview]
Message-ID: <1391029863-23099-4-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1391029863-23099-1-git-send-email-mkl@pengutronix.de>

From: "Ira W. Snyder" <iws@ovro.caltech.edu>

Analysis of the code shows that the struct ican3_msg variable cannot be
used uninitialized. Error conditions are checked and the loop terminates
before calling the ican3_handle_message() function with an uninitialized
value.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/janz-ican3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index e24e669..07f0ba0 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1322,7 +1322,7 @@ static int ican3_napi(struct napi_struct *napi, int budget)
 
 	/* process all communication messages */
 	while (true) {
-		struct ican3_msg msg;
+		struct ican3_msg uninitialized_var(msg);
 		ret = ican3_recv_msg(mod, &msg);
 		if (ret)
 			break;
-- 
1.8.5.3


  parent reply	other threads:[~2014-01-29 21:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29 21:11 pull-request: can 2014-01-29 Marc Kleine-Budde
2014-01-29 21:11 ` [PATCH 1/3] can: flexcan: fix flexcan driver build for big endian on ARM and little endian on PowerPc Marc Kleine-Budde
2014-01-29 21:11 ` [PATCH 2/3] can: Propagate SO_PRIORITY of raw sockets to skbs Marc Kleine-Budde
2014-01-29 21:11 ` Marc Kleine-Budde [this message]
2014-01-31  0:49 ` pull-request: can 2014-01-29 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1391029863-23099-4-git-send-email-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=iws@ovro.caltech.edu \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox