crypto: Fix initialization of array variable.
There are currently two issues recently observed:
-An array variable is not initialized.
-The 'podev' structure is currently being de-referenced without
verifying if it is NULL or not. Doing that could cause a crash.
This has not been seen before and it is pre-emptive.
Change-Id: I42440d6efc9593bd8f5807a6ffda6a4b2e71818c
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
diff --git a/drivers/crypto/msm/qcedev.c b/drivers/crypto/msm/qcedev.c
index fff494c..2a191d5 100644
--- a/drivers/crypto/msm/qcedev.c
+++ b/drivers/crypto/msm/qcedev.c
@@ -352,7 +352,7 @@
}
kzfree(handle);
file->private_data = NULL;
- if (podev->platform_support.bus_scale_table != NULL)
+ if (podev != NULL && podev->platform_support.bus_scale_table != NULL)
qcedev_ce_high_bw_req(podev, false);
return 0;
}
diff --git a/drivers/crypto/msm/qcrypto.c b/drivers/crypto/msm/qcrypto.c
index 21c3aff..63dfc2d 100644
--- a/drivers/crypto/msm/qcrypto.c
+++ b/drivers/crypto/msm/qcrypto.c
@@ -888,7 +888,7 @@
ctx->authsize, 1);
} else {
- unsigned char tmp[SHA256_DIGESTSIZE];
+ unsigned char tmp[SHA256_DIGESTSIZE] = {0};
/* compare icv from src */
scatterwalk_map_and_copy(tmp,