Browse Source

crypto: sa2ul: Intialize variables and fix build warning

drivers/crypto/sa2ul.c: In function ‘sa_init_sc’:
drivers/crypto/sa2ul.c:622:21: warning: ‘auth_sc_offset’ may be
used uninitialized in this function [-Wmaybe-uninitialized]
  int enc_sc_offset, auth_sc_offset;

Fix the above build warning.

Reported-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Keerthy 6 years ago
parent
commit
aeb12ac96c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/crypto/sa2ul.c

+ 1 - 1
drivers/crypto/sa2ul.c

@@ -619,7 +619,7 @@ int sa_init_sc(struct sa_ctx_info *ctx, const u8 *enc_key,
 	       struct algo_data *ad, u8 enc, u32 *swinfo, bool auth_req)
 {
 	int use_enc = 0;
-	int enc_sc_offset, auth_sc_offset;
+	int enc_sc_offset = 0, auth_sc_offset = 0;
 	u8 *sc_buf = ctx->sc;
 	u16 sc_id = ctx->sc_id;
 	u16 aad_len = 0;	/* Currently not supporting AEAD algo */