From: Ira W. Snyder Date: Wed, 29 Jan 2014 17:58:25 +0000 (-0800) Subject: can: janz-ican3: fix uninitialized variable warnings X-Git-Tag: v3.14-rc3~36^2~66^2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=73615c8669ef1c497c942cae0d5079b95824332a;p=~emulex%2Finfiniband.git can: janz-ican3: fix uninitialized variable warnings 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 Acked-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde --- diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c index e24e6690d67..07f0ba03cd5 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;